-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
5ee2bf2d.6bf75c0d.js
1 lines (1 loc) · 7.23 KB
/
5ee2bf2d.6bf75c0d.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{119:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),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 p(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 l=a.a.createContext({}),b=function(e){var t=a.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},s=function(e){var t=b(e.components);return a.a.createElement(l.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,c=e.parentName,l=p(e,["components","mdxType","originalType","parentName"]),s=b(n),d=r,m=s["".concat(c,".").concat(d)]||s[d]||u[d]||o;return n?a.a.createElement(m,i(i({ref:t},l),{},{components:n})):a.a.createElement(m,i({ref:t},l))}));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]=d;var i={};for(var p in t)hasOwnProperty.call(t,p)&&(i[p]=t[p]);i.originalType=e,i.mdxType="string"==typeof e?e:r,c[1]=i;for(var l=2;l<o;l++)c[l]=n[l];return a.a.createElement.apply(null,c)}return a.a.createElement.apply(null,n)}d.displayName="MDXCreateElement"},90:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return p})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return s}));var r=n(3),a=n(7),o=(n(0),n(119)),c=["components"],i={title:"Upgrade guide",sidebar_label:"Upgrading"},p={unversionedId:"upgrading",id:"upgrading",isDocsHomePage:!1,title:"Upgrade guide",description:"Migrating to ScalaPB 0.7.x",source:"@site/../docs/target/mdoc/upgrading.md",slug:"/upgrading",permalink:"/docs/upgrading",version:"current",sidebar_label:"Upgrading",sidebar:"someSidebar",previous:{title:"Writing protoc plugins in Scala",permalink:"/docs/writing-plugins"},next:{title:"Frequently Asked Questions",permalink:"/docs/faq"}},l=[{value:"Migrating to ScalaPB 0.7.x",id:"migrating-to-scalapb-07x",children:[]},{value:"Migrating from sbt-scalapb to sbt-protoc",id:"migrating-from-sbt-scalapb-to-sbt-protoc",children:[]}],b={toc:l};function s(e){var t=e.components,n=Object(a.a)(e,c);return Object(o.b)("wrapper",Object(r.a)({},b,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)("h2",{id:"migrating-to-scalapb-07x"},"Migrating to ScalaPB 0.7.x"),Object(o.b)("p",null,"From version 0.7.0 and onwards, ScalaPB artifacts are published under the ",Object(o.b)("inlineCode",{parentName:"p"},"com.thesamet.scalapb")," group id instead of the com.trueaccord.scalapb group id."),Object(o.b)("p",null,"In addition, all classes in the ",Object(o.b)("inlineCode",{parentName:"p"},"com.trueaccord.scalapb")," are moved to the ",Object(o.b)("inlineCode",{parentName:"p"},"scalapb")," top-level\npackage. During 0.7.x, we will keep type aliases and references in the original ",Object(o.b)("inlineCode",{parentName:"p"},"com.trueaccord.scalapb"),"\nlocation so you may get deprecation warnings, but your code is unlikely to break."),Object(o.b)("p",null,'You will need to "sbt clean" and "sbt compile" again, to make sure the old generated classes\nare removed and new ones are generated. The generated code should not yield any deprecation warnings.'),Object(o.b)("p",null,"Since the artifact name has changed, you will need to make sure all your other ScalaPB\ndependencies, such as ",Object(o.b)("inlineCode",{parentName:"p"},"scalapb-json4s")," and ",Object(o.b)("inlineCode",{parentName:"p"},"sparksql-scalapb"),", are updated to 0.7.x. Otherwise,\nthey will pull an additional copy of ScalaPB from the old group id name."),Object(o.b)("h2",{id:"migrating-from-sbt-scalapb-to-sbt-protoc"},"Migrating from sbt-scalapb to sbt-protoc"),Object(o.b)("p",null,"In ",Object(o.b)("inlineCode",{parentName:"p"},"project/scalapb.proto")," or ",Object(o.b)("inlineCode",{parentName:"p"},"project/plugins.proto"),", remove the library\ndependency on ",Object(o.b)("inlineCode",{parentName:"p"},"sbt-scalapb"),"."),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"Add")," ",Object(o.b)("inlineCode",{parentName:"p"},"sbt-protoc")," plugin:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre"},'addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.6")\n')),Object(o.b)("p",null,"If you had a dependency on ",Object(o.b)("inlineCode",{parentName:"p"},"protoc-jar")," it can be removed, since it is now\nprovided through ",Object(o.b)("inlineCode",{parentName:"p"},"sbt-protoc"),"."),Object(o.b)("p",null,"In ",Object(o.b)("inlineCode",{parentName:"p"},"build.sbt"),":"),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"Remove")," this line:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre"},"import com.trueaccord.scalapb.{ScalaPbPlugin => PB}\n")),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"Remove")," this line:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre"},"PB.protobufSettings\n")),Object(o.b)("p",null,"If you set up ",Object(o.b)("inlineCode",{parentName:"p"},"protoc-jar"),", you can also ",Object(o.b)("strong",{parentName:"p"},"remove")," this setting, since this\nis the default:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre"},'PB.runProtoc in PB.protobufConfig := (args =>\n com.github.os72.protocjar.Protoc.runProtoc("-v300" +: args.toArray))\n')),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"Add")," a value to ",Object(o.b)("inlineCode",{parentName:"p"},"gen.targets"),":"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre"},"Compile / PB.targets := Seq(\n scalapb.gen() -> (Compile / sourceManaged).value\n)\n")),Object(o.b)("p",null,"If you need Java Conversions, flat packages, etc see\n",Object(o.b)("a",{parentName:"p",href:"/docs/sbt-settings"},"ScalaPB SBT Settings"),"."),Object(o.b)("p",null,"If you are using files like ",Object(o.b)("inlineCode",{parentName:"p"},"scalapb.proto")," and Google's well-known proto\nchange the library dependency from:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre"},'"com.trueaccord.scalapb" %% "scalapb-runtime" % "0.11.11" % PB.protobufConfig\n')),Object(o.b)("p",null,"to:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre"},'"com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf"\n')))}s.isMDXComponent=!0}}]);