Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade Gradle build system in generated library repo and fix setup issue #876

Merged
merged 4 commits into from
Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rules_java_gapic/java_gapic_pkg.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ def _java_gapic_build_configs_pkg_impl(ctx):

substitutions = dict(ctx.attr.static_substitutions)
substitutions["{{extra_deps}}"] = _construct_extra_deps({
"compile": ctx.attr.deps,
"testCompile": ctx.attr.test_deps,
"implementation": ctx.attr.deps,
"testImplementation": ctx.attr.test_deps,
}, substitutions)

for template in ctx.attr.templates.items():
Expand Down
20 changes: 7 additions & 13 deletions rules_java_gapic/resources/gradle/assembly.gradle.tmpl
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
buildscript {
repositories {
mavenLocal()
maven {
url 'https://plugins.gradle.org/m2/'
}
mavenCentral()
}
}

subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'java-library'
apply plugin: 'maven-publish'

sourceCompatibility = 1.8
targetCompatibility = 1.8
Expand All @@ -23,7 +13,11 @@ subprojects {
}

repositories {
mavenLocal()
mavenCentral()
mavenLocal()
}

publishing.publications {
library(MavenPublication).from components.java
}
}
33 changes: 9 additions & 24 deletions rules_java_gapic/resources/gradle/client_grpc.gradle.tmpl
Original file line number Diff line number Diff line change
@@ -1,32 +1,17 @@
buildscript {
repositories {
mavenCentral()
}
}

apply plugin: 'java'

description = 'GAPIC library for {{name}}'
group = 'com.google.cloud'
version = (findProperty('version') == 'unspecified') ? '0.0.0-SNAPSHOT' : version
sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
mavenCentral()
mavenLocal()
}
version = (version == 'unspecified') ? '0.0.0-SNAPSHOT' : version

compileJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'

dependencies {
compile 'com.google.api:gax:{{version.gax}}'
testCompile 'com.google.api:gax:{{version.gax}}:testlib'
compile 'com.google.api:gax-grpc:{{version.gax_grpc}}'
testCompile 'com.google.api:gax-grpc:{{version.gax_grpc}}:testlib'
testCompile 'io.grpc:grpc-netty-shaded:{{version.io_grpc}}'
testCompile '{{maven.junit_junit}}'
implementation 'com.google.api:gax:{{version.gax}}'
testImplementation 'com.google.api:gax:{{version.gax}}:testlib'
implementation 'com.google.api:gax-grpc:{{version.gax_grpc}}'
testImplementation 'com.google.api:gax-grpc:{{version.gax_grpc}}:testlib'
testImplementation 'io.grpc:grpc-netty-shaded:{{version.io_grpc}}'
testImplementation '{{maven.junit_junit}}'
{{extra_deps}}
}

Expand Down Expand Up @@ -56,6 +41,6 @@ clean {
task allJars(type: Copy) {
dependsOn test, jar
into 'all-jars'
// Replace with `from configurations.testRuntime, jar` to include test dependencies
from configurations.runtime, jar
// Replace with `from configurations.testRuntimeOnly, jar` to include test dependencies
from configurations.runtimeOnly, jar
}
37 changes: 11 additions & 26 deletions rules_java_gapic/resources/gradle/client_grpcrest.gradle.tmpl
Original file line number Diff line number Diff line change
@@ -1,34 +1,19 @@
buildscript {
repositories {
mavenCentral()
}
}

apply plugin: 'java'

description = 'GAPIC library for {{name}}'
group = 'com.google.cloud'
version = (findProperty('version') == 'unspecified') ? '0.0.0-SNAPSHOT' : version
sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
mavenCentral()
mavenLocal()
}
version = (version == 'unspecified') ? '0.0.0-SNAPSHOT' : version

compileJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'

dependencies {
compile 'com.google.api:gax:{{version.gax}}'
testCompile 'com.google.api:gax:{{version.gax}}:testlib'
compile 'com.google.api:gax-grpc:{{version.gax_grpc}}'
testCompile 'com.google.api:gax-grpc:{{version.gax_grpc}}:testlib'
compile 'com.google.api:gax-httpjson:{{version.gax_httpjson}}'
testCompile 'com.google.api:gax-httpjson:{{version.gax_httpjson}}:testlib'
testCompile 'io.grpc:grpc-netty-shaded:{{version.io_grpc}}'
testCompile '{{maven.junit_junit}}'
implementation 'com.google.api:gax:{{version.gax}}'
testImplementation 'com.google.api:gax:{{version.gax}}:testlib'
implementation 'com.google.api:gax-grpc:{{version.gax_grpc}}'
testImplementation 'com.google.api:gax-grpc:{{version.gax_grpc}}:testlib'
implementation 'com.google.api:gax-httpjson:{{version.gax_httpjson}}'
testImplementation 'com.google.api:gax-httpjson:{{version.gax_httpjson}}:testlib'
testImplementation 'io.grpc:grpc-netty-shaded:{{version.io_grpc}}'
testImplementation '{{maven.junit_junit}}'
{{extra_deps}}
}

Expand Down Expand Up @@ -58,6 +43,6 @@ clean {
task allJars(type: Copy) {
dependsOn test, jar
into 'all-jars'
// Replace with `from configurations.testRuntime, jar` to include test dependencies
from configurations.runtime, jar
// Replace with `from configurations.testRuntimeOnly, jar` to include test dependencies
from configurations.runtimeOnly, jar
}
31 changes: 8 additions & 23 deletions rules_java_gapic/resources/gradle/client_rest.gradle.tmpl
Original file line number Diff line number Diff line change
@@ -1,31 +1,16 @@
buildscript {
repositories {
mavenCentral()
}
}

apply plugin: 'java'

description = 'GAPIC library for {{name}}'
group = 'com.google.cloud'
version = (findProperty('version') == 'unspecified') ? '0.0.0-SNAPSHOT' : version
sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
mavenCentral()
mavenLocal()
}
version = (version == 'unspecified') ? '0.0.0-SNAPSHOT' : version

compileJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'

dependencies {
compile 'com.google.api:gax:{{version.gax}}'
testCompile 'com.google.api:gax:{{version.gax}}:testlib'
compile 'com.google.api:gax-httpjson:{{version.gax_httpjson}}'
testCompile 'com.google.api:gax-httpjson:{{version.gax_httpjson}}:testlib'
testCompile '{{maven.junit_junit}}'
implementation 'com.google.api:gax:{{version.gax}}'
testImplementation 'com.google.api:gax:{{version.gax}}:testlib'
implementation 'com.google.api:gax-httpjson:{{version.gax_httpjson}}'
testImplementation 'com.google.api:gax-httpjson:{{version.gax_httpjson}}:testlib'
testImplementation '{{maven.junit_junit}}'
{{extra_deps}}
}

Expand Down Expand Up @@ -55,6 +40,6 @@ clean {
task allJars(type: Copy) {
dependsOn test, jar
into 'all-jars'
// Replace with `from configurations.testRuntime, jar` to include test dependencies
from configurations.runtime, jar
// Replace with `from configurations.testRuntimeOnly, jar` to include test dependencies
from configurations.runtimeOnly, jar
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Mon May 02 22:26:16 PDT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
Loading