-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #175 from eed3si9n/wip/exclude3
protobufExcludeFilters
- Loading branch information
Showing
5 changed files
with
94 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
enablePlugins(ProtobufPlugin) | ||
version := "0.1.0-SNAPSHOT" | ||
name := "exclude-test" | ||
scalaVersion := "2.13.13" | ||
|
||
libraryDependencies ++= Seq( | ||
"com.google.protobuf" % "protobuf-java" % (ProtobufConfig / version).value % ProtobufConfig, | ||
) | ||
|
||
ProtobufConfig / sourceDirectories += (ProtobufConfig / protobufExternalIncludePath).value | ||
|
||
TaskKey[Unit]("checkJar") := { | ||
val jar = (Compile / packageBin).value | ||
IO.withTemporaryDirectory{ dir => | ||
val files = IO.unzip(jar, dir) | ||
val expect = Set(dir / "META-INF" / "MANIFEST.MF") | ||
assert(files == expect, s"""actual = $files, | ||
expected = $expect""") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
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.github.sbt" % "sbt-protobuf" % pluginVersion) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
> checkJar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// So that publishLocal doesn't continuously create new versions | ||
def versionFmt(out: sbtdynver.GitDescribeOutput): String = { | ||
val snapshotSuffix = | ||
if (out.isSnapshot()) "-SNAPSHOT" | ||
else "" | ||
out.ref.dropPrefix + snapshotSuffix | ||
} | ||
def fallbackVersion(d: java.util.Date): String = s"HEAD-${sbtdynver.DynVer timestamp d}" | ||
ThisBuild / version := dynverGitDescribeOutput.value.mkVersion(versionFmt, fallbackVersion(dynverCurrentDate.value)) | ||
ThisBuild / dynver := { | ||
val d = new java.util.Date | ||
sbtdynver.DynVer.getGitDescribeOutput(d).mkVersion(versionFmt, fallbackVersion(d)) | ||
} |