-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
b681c370.c4d09928.js
1 lines (1 loc) · 4.46 KB
/
b681c370.c4d09928.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{104:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return l})),n.d(t,"toc",(function(){return p})),n.d(t,"default",(function(){return u}));var r=n(3),a=n(7),o=(n(0),n(119)),c=["components"],i={sidebar_label:"Dotty",title:"Using with Dotty"},l={unversionedId:"dotty",id:"dotty",isDocsHomePage:!1,title:"Using with Dotty",description:"Installing in SBT",source:"@site/../docs/target/mdoc/dotty.md",slug:"/dotty",permalink:"/docs/dotty",version:"current",sidebar_label:"Dotty",sidebar:"someSidebar",previous:{title:"ScalaPBC: ScalaPB's standalone compiler",permalink:"/docs/scalapbc"},next:{title:"Using third-party protos",permalink:"/docs/third-party-protos"}},p=[{value:"Installing in SBT",id:"installing-in-sbt",children:[]},{value:"Generated code",id:"generated-code",children:[]}],s={toc:p};function u(e){var t=e.components,n=Object(a.a)(e,c);return Object(o.b)("wrapper",Object(r.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)("h2",{id:"installing-in-sbt"},"Installing in SBT"),Object(o.b)("p",null,"ScalaPB 0.11.x fully supports Dotty. There is no need to use ",Object(o.b)("inlineCode",{parentName:"p"},"withDottyCompat"),"\nto get the runtime dependencies correctly added."),Object(o.b)("p",null,"To use ScalaPB with dotty, ensure you use a recent sbt-protoc."),Object(o.b)("p",null,"In ",Object(o.b)("inlineCode",{parentName:"p"},"project/plugins.sbt"),":"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-scala"},'addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.6")\n\nlibraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.11.11"\n')),Object(o.b)("p",null,"In build.sbt:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-scala"},'scalaVersion := "3.3.3"\n\nCompile / PB.targets := Seq(\n scalapb.gen() -> (Compile / sourceManaged).value / "scalapb"\n)\n')),Object(o.b)("h2",{id:"generated-code"},"Generated code"),Object(o.b)("p",null,"The generated code is designed to compile cleanly on all support versions of\nthe Scala compiler with the default compiler settings. It is known that currently\nthe generator will provide an error if ",Object(o.b)("inlineCode",{parentName:"p"},"-language:strictEquality")," is set."))}u.isMDXComponent=!0},119:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return m}));var r=n(0),a=n.n(r);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var p=a.a.createContext({}),s=function(e){var t=a.a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=s(e.components);return a.a.createElement(p.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},b=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=s(n),b=r,m=u["".concat(c,".").concat(b)]||u[b]||d[b]||o;return n?a.a.createElement(m,i(i({ref:t},p),{},{components:n})):a.a.createElement(m,i({ref:t},p))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,c=new Array(o);c[0]=b;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:r,c[1]=i;for(var p=2;p<o;p++)c[p]=n[p];return a.a.createElement.apply(null,c)}return a.a.createElement.apply(null,n)}b.displayName="MDXCreateElement"}}]);