From 58a159a3ef48792fed1c6c793326c1dd4a9ab028 Mon Sep 17 00:00:00 2001 From: Shin Fan Date: Fri, 19 May 2017 10:26:30 -0700 Subject: [PATCH 1/4] Remove staging build file --- .../google/api/codegen/metadatagen/java/grpc/package.snip | 5 +++-- .../grpcmetadatagen/testdata/java_common_protos.baseline | 3 ++- .../grpcmetadatagen/testdata/java_grpc_stubs.baseline | 5 +++-- .../codegen/grpcmetadatagen/testdata/java_library.baseline | 7 ++++--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/resources/com/google/api/codegen/metadatagen/java/grpc/package.snip b/src/main/resources/com/google/api/codegen/metadatagen/java/grpc/package.snip index 8a9967f28c..81349d513a 100644 --- a/src/main/resources/com/google/api/codegen/metadatagen/java/grpc/package.snip +++ b/src/main/resources/com/google/api/codegen/metadatagen/java/grpc/package.snip @@ -152,6 +152,7 @@ task updateDocsWithCurrentVersion { dependsOn 'createApiDocsRedirect' } + @end @private dependencies(metadata) @@ -161,12 +162,12 @@ compile "com.google.protobuf:protobuf-java:{@metadata.protoVersionBound.lower}" compile "com.google.api:api-common:{@metadata.apiCommonVersionBound.lower}" @join dependency : metadata.protoPackageDependencies - compile "com.google.api.grpc:{@dependency.name}:{@dependency.versionBound.lower}" + compile project(":{@dependency.name}") @end @case "GRPC" compile "io.grpc:grpc-stub:{@metadata.grpcVersionBound.lower}" compile "io.grpc:grpc-protobuf:{@metadata.grpcVersionBound.lower}" - compile "com.google.api.grpc:{@metadata.protoPackageName}:{@metadata.packageVersionBound.lower}" + compile project(":{@metadata.protoPackageName}") @default $unhandledCase: {@metadata.generationLayer}$ @end diff --git a/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_common_protos.baseline b/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_common_protos.baseline index a994775753..85869c75ae 100644 --- a/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_common_protos.baseline +++ b/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_common_protos.baseline @@ -311,7 +311,7 @@ if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword') tasks.uploadArchives.dependsOn(failUploadArchives) } -task checkOutGhPages { +task checkOutGhPages << { if (!new File('tmp_gh-pages').exists()) { exec { commandLine 'git', 'clone', '--branch', 'gh-pages', @@ -358,3 +358,4 @@ task createApiDocsRedirect { task updateDocsWithCurrentVersion { dependsOn 'createApiDocsRedirect' } + diff --git a/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_grpc_stubs.baseline b/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_grpc_stubs.baseline index 850bd376b7..8e0f771574 100644 --- a/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_grpc_stubs.baseline +++ b/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_grpc_stubs.baseline @@ -226,7 +226,7 @@ repositories { dependencies { compile "io.grpc:grpc-stub:1.0.1" compile "io.grpc:grpc-protobuf:1.0.1" - compile "com.google.api.grpc:proto-google-cloud-library-v1:0.1.7" + compile project(":proto-google-cloud-library-v1") } ext { @@ -312,7 +312,7 @@ if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword') tasks.uploadArchives.dependsOn(failUploadArchives) } -task checkOutGhPages { +task checkOutGhPages << { if (!new File('tmp_gh-pages').exists()) { exec { commandLine 'git', 'clone', '--branch', 'gh-pages', @@ -359,3 +359,4 @@ task createApiDocsRedirect { task updateDocsWithCurrentVersion { dependsOn 'createApiDocsRedirect' } + diff --git a/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_library.baseline b/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_library.baseline index 6386b865e2..c55298ed4f 100644 --- a/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_library.baseline +++ b/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_library.baseline @@ -226,8 +226,8 @@ repositories { dependencies { compile "com.google.protobuf:protobuf-java:3.0.0" compile "com.google.api:api-common:0.0.2" - compile "com.google.api.grpc:proto-google-common-protos:0.1.6" - compile "com.google.api.grpc:proto-google-some-other-package-v1:0.0.0" + compile project(":proto-google-common-protos") + compile project(":proto-google-some-other-package-v1") } ext { @@ -313,7 +313,7 @@ if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword') tasks.uploadArchives.dependsOn(failUploadArchives) } -task checkOutGhPages { +task checkOutGhPages << { if (!new File('tmp_gh-pages').exists()) { exec { commandLine 'git', 'clone', '--branch', 'gh-pages', @@ -360,3 +360,4 @@ task createApiDocsRedirect { task updateDocsWithCurrentVersion { dependsOn 'createApiDocsRedirect' } + From a9ab4d95e94dc56863158548eacb9a912fa55352 Mon Sep 17 00:00:00 2001 From: Shin Fan Date: Fri, 19 May 2017 10:34:09 -0700 Subject: [PATCH 2/4] Address PR feedback --- .../java/JavaGrpcPackageMetadataTransformer.java | 2 +- .../java/JavaProtoPackageMetadataTransformer.java | 2 +- .../metadatagen/java/grpc/{package.snip => build.gradle.snip} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename src/main/resources/com/google/api/codegen/metadatagen/java/grpc/{package.snip => build.gradle.snip} (100%) diff --git a/src/main/java/com/google/api/codegen/grpcmetadatagen/java/JavaGrpcPackageMetadataTransformer.java b/src/main/java/com/google/api/codegen/grpcmetadatagen/java/JavaGrpcPackageMetadataTransformer.java index e6a3b99e16..0967ee0d0a 100644 --- a/src/main/java/com/google/api/codegen/grpcmetadatagen/java/JavaGrpcPackageMetadataTransformer.java +++ b/src/main/java/com/google/api/codegen/grpcmetadatagen/java/JavaGrpcPackageMetadataTransformer.java @@ -22,7 +22,7 @@ public class JavaGrpcPackageMetadataTransformer extends JavaPackageMetadataTrans private final Map snippetsOutput = ImmutableMap.of( "LICENSE.snip", "LICENSE", - "metadatagen/java/grpc/package.snip", "build.gradle"); + "metadatagen/java/grpc/build.gradle.snip", "build.gradle"); @Override protected Map getSnippetsOutput() { diff --git a/src/main/java/com/google/api/codegen/grpcmetadatagen/java/JavaProtoPackageMetadataTransformer.java b/src/main/java/com/google/api/codegen/grpcmetadatagen/java/JavaProtoPackageMetadataTransformer.java index cde6ace7e2..fb80fd6815 100644 --- a/src/main/java/com/google/api/codegen/grpcmetadatagen/java/JavaProtoPackageMetadataTransformer.java +++ b/src/main/java/com/google/api/codegen/grpcmetadatagen/java/JavaProtoPackageMetadataTransformer.java @@ -23,7 +23,7 @@ public class JavaProtoPackageMetadataTransformer extends JavaPackageMetadataTran private final Map snippetsOutput = ImmutableMap.of( "LICENSE.snip", "LICENSE", - "metadatagen/java/grpc/package.snip", "build.gradle"); + "metadatagen/java/grpc/build.gradle.snip", "build.gradle"); @Override protected Map getSnippetsOutput() { diff --git a/src/main/resources/com/google/api/codegen/metadatagen/java/grpc/package.snip b/src/main/resources/com/google/api/codegen/metadatagen/java/grpc/build.gradle.snip similarity index 100% rename from src/main/resources/com/google/api/codegen/metadatagen/java/grpc/package.snip rename to src/main/resources/com/google/api/codegen/metadatagen/java/grpc/build.gradle.snip From 3d2aaf2c5536749faa87b4ef77fd7d8bf23dcef5 Mon Sep 17 00:00:00 2001 From: Shin Fan Date: Fri, 19 May 2017 10:44:17 -0700 Subject: [PATCH 3/4] Update tests --- .../grpcmetadatagen/testdata/java_common_protos.baseline | 2 +- .../codegen/grpcmetadatagen/testdata/java_grpc_stubs.baseline | 2 +- .../api/codegen/grpcmetadatagen/testdata/java_library.baseline | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_common_protos.baseline b/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_common_protos.baseline index 85869c75ae..a6de7fa383 100644 --- a/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_common_protos.baseline +++ b/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_common_protos.baseline @@ -311,7 +311,7 @@ if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword') tasks.uploadArchives.dependsOn(failUploadArchives) } -task checkOutGhPages << { +task checkOutGhPages { if (!new File('tmp_gh-pages').exists()) { exec { commandLine 'git', 'clone', '--branch', 'gh-pages', diff --git a/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_grpc_stubs.baseline b/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_grpc_stubs.baseline index 8e0f771574..6d9549a6c0 100644 --- a/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_grpc_stubs.baseline +++ b/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_grpc_stubs.baseline @@ -312,7 +312,7 @@ if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword') tasks.uploadArchives.dependsOn(failUploadArchives) } -task checkOutGhPages << { +task checkOutGhPages { if (!new File('tmp_gh-pages').exists()) { exec { commandLine 'git', 'clone', '--branch', 'gh-pages', diff --git a/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_library.baseline b/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_library.baseline index c55298ed4f..7601ed9fd0 100644 --- a/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_library.baseline +++ b/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_library.baseline @@ -313,7 +313,7 @@ if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword') tasks.uploadArchives.dependsOn(failUploadArchives) } -task checkOutGhPages << { +task checkOutGhPages { if (!new File('tmp_gh-pages').exists()) { exec { commandLine 'git', 'clone', '--branch', 'gh-pages', From 7184161842257abffcdcf9e9308f117fe46b90a9 Mon Sep 17 00:00:00 2001 From: Shin Fan Date: Fri, 19 May 2017 11:24:26 -0700 Subject: [PATCH 4/4] Minor fix --- .../google/api/codegen/metadatagen/java/grpc/build.gradle.snip | 2 +- .../grpcmetadatagen/testdata/java_common_protos.baseline | 2 +- .../codegen/grpcmetadatagen/testdata/java_grpc_stubs.baseline | 2 +- .../api/codegen/grpcmetadatagen/testdata/java_library.baseline | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/resources/com/google/api/codegen/metadatagen/java/grpc/build.gradle.snip b/src/main/resources/com/google/api/codegen/metadatagen/java/grpc/build.gradle.snip index 81349d513a..861f0960a1 100644 --- a/src/main/resources/com/google/api/codegen/metadatagen/java/grpc/build.gradle.snip +++ b/src/main/resources/com/google/api/codegen/metadatagen/java/grpc/build.gradle.snip @@ -105,7 +105,7 @@ tasks.uploadArchives.dependsOn(failUploadArchives) } - task checkOutGhPages { + task checkOutGhPages << { if (!new File('tmp_gh-pages').exists()) { exec { commandLine 'git', 'clone', '--branch', 'gh-pages', diff --git a/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_common_protos.baseline b/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_common_protos.baseline index a6de7fa383..85869c75ae 100644 --- a/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_common_protos.baseline +++ b/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_common_protos.baseline @@ -311,7 +311,7 @@ if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword') tasks.uploadArchives.dependsOn(failUploadArchives) } -task checkOutGhPages { +task checkOutGhPages << { if (!new File('tmp_gh-pages').exists()) { exec { commandLine 'git', 'clone', '--branch', 'gh-pages', diff --git a/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_grpc_stubs.baseline b/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_grpc_stubs.baseline index 6d9549a6c0..8e0f771574 100644 --- a/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_grpc_stubs.baseline +++ b/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_grpc_stubs.baseline @@ -312,7 +312,7 @@ if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword') tasks.uploadArchives.dependsOn(failUploadArchives) } -task checkOutGhPages { +task checkOutGhPages << { if (!new File('tmp_gh-pages').exists()) { exec { commandLine 'git', 'clone', '--branch', 'gh-pages', diff --git a/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_library.baseline b/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_library.baseline index 7601ed9fd0..c55298ed4f 100644 --- a/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_library.baseline +++ b/src/test/java/com/google/api/codegen/grpcmetadatagen/testdata/java_library.baseline @@ -313,7 +313,7 @@ if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword') tasks.uploadArchives.dependsOn(failUploadArchives) } -task checkOutGhPages { +task checkOutGhPages << { if (!new File('tmp_gh-pages').exists()) { exec { commandLine 'git', 'clone', '--branch', 'gh-pages',