Skip to content

Commit

Permalink
Add scripted for PGV protos when project has flat_package=true
Browse files Browse the repository at this point in the history
  • Loading branch information
thesamet committed Jan 31, 2021
1 parent 46264e6 commit c3b432d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/sbt-test/integration/common-protos/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import scalapb.compiler.Version.protobufVersion

scalaVersion := "2.13.4"

Compile / PB.targets := Seq(scalapb.gen(flatPackage=true) -> (Compile / sourceManaged).value)

libraryDependencies ++= Seq(
"com.thesamet.scalapb.common-protos" %% "pgv-proto-scalapb_0.10" % "0.4.1-1" % "protobuf",
"com.thesamet.scalapb.common-protos" %% "pgv-proto-scalapb_0.10" % "0.4.1-1"
)
11 changes: 11 additions & 0 deletions src/sbt-test/integration/common-protos/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
val pluginVersion = System.getProperty("plugin.version")
if(pluginVersion == null)
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
else addSbtPlugin("com.thesamet" % "sbt-protoc" % pluginVersion)
}

libraryDependencies ++= Seq(
"com.thesamet.scalapb" %% "compilerplugin" % "0.10.11"
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
syntax = "proto3";

import "validate/validate.proto";

message Foo {
validate.Int32Rules rules = 1;
}
1 change: 1 addition & 0 deletions src/sbt-test/integration/common-protos/test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
> compile

0 comments on commit c3b432d

Please sign in to comment.