Skip to content

Commit

Permalink
Gradle plugin modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
dotbg committed Oct 6, 2020
1 parent 8973751 commit 00e84d4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ class AkkaGrpcPlugin implements Plugin<Project> {
protoc {
// Get protobuf from maven central instead of
// using the installed version:
artifact = "com.google.protobuf:protoc:${akkaGrpcExt.protocVersion}"
artifact = "com.google.protobuf:protoc:${akkaGrpcExt.PROTOC_VERSION}"
}
plugins {
akkaGrpc {
artifact = "com.lightbend.akka.grpc:akka-grpc-codegen_${akkaGrpcExt.protocPluginScalaVersion}:${baselineVersion}:${assemblyClassifier}@${assemblySuffix}"
artifact = "com.lightbend.akka.grpc:akka-grpc-codegen_${akkaGrpcExt.PROTOC_PLUGIN_SCALA_VERSION}:${baselineVersion}:${assemblyClassifier}@${assemblySuffix}"
}
if (akkaGrpcExt.scala) {
scalapb {
artifact = "com.lightbend.akka.grpc:akka-grpc-scalapb-protoc-plugin_${akkaGrpcExt.protocPluginScalaVersion}:${baselineVersion}:${assemblyClassifier}@${assemblySuffix}"
artifact = "com.lightbend.akka.grpc:akka-grpc-scalapb-protoc-plugin_${akkaGrpcExt.PROTOC_PLUGIN_SCALA_VERSION}:${baselineVersion}:${assemblyClassifier}@${assemblySuffix}"
}
}
}
Expand Down Expand Up @@ -146,7 +146,7 @@ class AkkaGrpcPlugin implements Plugin<Project> {
def scalaVersion = autodetectScala()
p.dependencies {
implementation "com.lightbend.akka.grpc:akka-grpc-runtime_${scalaVersion}:${baselineVersion}"
implementation "io.grpc:grpc-stub:${akkaGrpcExt.grpcVersion}"
implementation "io.grpc:grpc-stub:${akkaGrpcExt.GRPC_VERSION}"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import org.gradle.api.Project

class AkkaGrpcPluginExtension {

static final String PROTOC_VERSION = "3.11.0"

static final String PROTOC_PLUGIN_SCALA_VERSION = "2.12"

static final String GRPC_VERSION = "1.32.1"

static final String PLUGIN_CODE = 'com.lightbend.akka.grpc.gradle'

// workaround for tests, where there's no jar and MANIFEST.MF can't be read
Expand All @@ -16,9 +22,6 @@ class AkkaGrpcPluginExtension {
boolean serverPowerApis = false
boolean usePlayActions = false
boolean includeStdTypes = false
String protocVersion = "3.11.4"
String grpcVersion = "1.32.1"
String protocPluginScalaVersion = "2.12"

List<String> extraGenerators = []

Expand Down
2 changes: 1 addition & 1 deletion gradle-plugin/src/test/groovy/unit/DependenciesSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class DependenciesSpec extends BaseSpec {
then: "added to configuration"
def deps = project.configurations.implementation.dependencies
deps.any { it.name == "akka-grpc-runtime_$scala" && it.version == akkaGrpcExt.pluginVersion }
deps.any { it.name == "grpc-stub" && it.version == akkaGrpcExt.grpcVersion }
deps.any { it.name == "grpc-stub" && it.version == akkaGrpcExt.GRPC_VERSION }
where:
plugin || scala
"java" | "2.12"
Expand Down
11 changes: 4 additions & 7 deletions plugin-tester-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,21 @@ plugins {
id 'com.lightbend.akka.grpc.gradle'
}

def scalaVersion = org.gradle.util.VersionNumber.parse(System.getenv("TRAVIS_SCALA_VERSION") ?: "2.12")
def scalaBinaryVersion = "${scalaVersion.major}.${scalaVersion.minor}"

akkaGrpc {
generateClient = true
generateServer = true
serverPowerApis = true // This isn't default
includeStdTypes = true
grpcVersion = "1.32.1"
protocVersion = "3.11.4"
protocPluginScalaVersion = "${scalaBinaryVersion}"
includeStdTypes = true // This isn't default
extraGenerators = [ ]
}

repositories {
mavenLocal()
}

def scalaVersion = org.gradle.util.VersionNumber.parse(System.getenv("TRAVIS_SCALA_VERSION") ?: "2.12")
def scalaBinaryVersion = "${scalaVersion.major}.${scalaVersion.minor}"

dependencies {
implementation group: 'ch.megard', name: "akka-http-cors_${scalaBinaryVersion}", version: '1.0.0'
testImplementation "com.typesafe.akka:akka-stream-testkit_${scalaBinaryVersion}:2.5.31"
Expand Down

0 comments on commit 00e84d4

Please sign in to comment.