Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
build: upgrade to nexus-publish plugin (#1499)
Browse files Browse the repository at this point in the history
chore: remove linkage monitor check
  • Loading branch information
Neenu1995 committed Oct 8, 2021
1 parent 7d59312 commit d6b2f2f
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 65 deletions.
2 changes: 0 additions & 2 deletions .github/sync-repo-settings.yaml
Expand Up @@ -9,8 +9,6 @@ branchProtectionRules:
requiresStrictStatusChecks: true
requiredStatusCheckContexts:
- bazel
- linkage-monitor (8)
- linkage-monitor (11)
- units (8)
- units (11)
- cla/google
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/ci.yaml
Expand Up @@ -61,23 +61,3 @@ jobs:
name: test-artifacts
path: ~/.cache/bazel/*/*/*/gax-java/bazel-out/*/testlogs/*
retention-days: 5

linkage-monitor:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 11]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- run: java -version
- name: Build and install local Maven repository
run: ./gradlew build publishToMavenLocal -x test -x signMavenJavaPublication
- name: Generate artifact list (linkage-monitor-artifacts.txt) for Linkage Monitor
run: ./gradlew createLinkageMonitorArtifactList
- name: Check dependency conflicts with the latest Libraries BOM
uses: GoogleCloudPlatform/cloud-opensource-java/linkage-monitor@v1-linkagemonitor
- name: Check dependency conflicts in the gax artifacts
run: ./gradlew checkJavaLinkage -x signMavenJavaPublication
7 changes: 1 addition & 6 deletions .kokoro/release/stage.sh
Expand Up @@ -30,9 +30,4 @@ setup_environment_secrets
mkdir -p ${HOME}/.gradle
create_gradle_properties_file "${HOME}/.gradle/gradle.properties"

./gradlew assemble publish

if [[ -n "${AUTORELEASE_PR}" ]]
then
./gradlew closeAndReleaseRepository
fi
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
10 changes: 5 additions & 5 deletions benchmark/build.gradle
Expand Up @@ -19,11 +19,11 @@ repositories {
}

dependencies {
compile project(':gax')
compile project(':gax-grpc')
compile "io.grpc:grpc-netty:${libraries['version.io_grpc']}"
compile 'com.google.api.grpc:grpc-google-cloud-bigtable-v2:2.1.4'
compile 'com.google.api.grpc:grpc-google-cloud-pubsub-v1:1.96.6'
implementation project(':gax')
implementation project(':gax-grpc')
implementation "io.grpc:grpc-netty:${libraries['version.io_grpc']}"
implementation 'com.google.api.grpc:grpc-google-cloud-bigtable-v2:2.1.4'
implementation 'com.google.api.grpc:grpc-google-cloud-pubsub-v1:1.96.6'
}

// Allow command line to target specific test
Expand Down
30 changes: 17 additions & 13 deletions build.gradle
Expand Up @@ -10,9 +10,9 @@ buildscript {
jcenter()
}
dependencies {
classpath "net.ltgt.gradle:gradle-apt-plugin:0.10",
classpath "net.ltgt.gradle:gradle-apt-plugin:0.21",
"com.github.jengelman.gradle.plugins:shadow:6.1.0",
"io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0",
"io.github.gradle-nexus:publish-plugin:1.1.0",
"gradle.plugin.com.dorongold.plugins:task-tree:1.5"

classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.8"
Expand All @@ -21,7 +21,7 @@ buildscript {

apply plugin: 'java'
apply plugin: 'com.github.sherter.google-java-format'
apply plugin: 'io.codearte.nexus-staging'
apply plugin: 'io.github.gradle-nexus.publish-plugin'

// TODO: Populate this from dependencies.properties version property (for proper Gradle-Bazel sync)
project.version = "2.5.1-SNAPSHOT" // {x-version-update:gax:current}
Expand All @@ -46,12 +46,16 @@ verifyGoogleJavaFormat.onlyIf { JavaVersion.current().isJava8Compatible() }

if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword') &&
!nonReleaseProjects.contains(project.name)) {
// Nexus staging plugin only works at root project level
// See https://github.com/Codearte/gradle-nexus-staging-plugin/issues/47
nexusStaging {
username = ossrhUsername
password = ossrhPassword
nexusPublishing {
packageGroup = "com.google.api"
repositories {
sonatype { //or custom repository name
nexusUrl.set(uri('https://google.oss.sonatype.org/service/local/'))
snapshotRepositoryUrl.set(uri('https://google.oss.sonatype.org/content/repositories/snapshots/'))
username = ossrhUsername
password = ossrhPassword
}
}
}
}

Expand Down Expand Up @@ -95,8 +99,8 @@ allprojects {

subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'idea'
apply plugin: 'jacoco'
apply plugin: 'signing'
Expand Down Expand Up @@ -261,12 +265,12 @@ subprojects {

configurations {
codeGeneration
compile.exclude group: 'com.google.guava', module: 'guava-jdk5'
implementation.exclude group: 'com.google.guava', module: 'guava-jdk5'
}

dependencies {
codeGeneration libraries['maven.com_google_auto_value_auto_value'],
libraries['maven.com_google_code_findbugs_jsr305']
codeGeneration (libraries['maven.com_google_auto_value_auto_value'],
libraries['maven.com_google_code_findbugs_jsr305'])

// Separate configuration (class path) for Linkage Checker
linkageChecker "com.google.cloud.tools:dependencies:1.4.0"
Expand Down Expand Up @@ -484,7 +488,7 @@ task createApiDocsRedirect {
}

task publishDocs {
dependsOn 'closeAndReleaseRepository'
dependsOn 'closeAndReleaseSonatypeStagingRepository'
doLast {
exec {
workingDir './tmp_gh-pages'
Expand Down
8 changes: 4 additions & 4 deletions gax-grpc/build.gradle
Expand Up @@ -4,7 +4,7 @@ archivesBaseName = "gax-grpc"
project.version = "2.5.1-SNAPSHOT" // {x-version-update:gax-grpc:current}

dependencies {
compile project(':gax'),
implementation( project(':gax'),
libraries['maven.io_grpc_grpc_stub'],
libraries['maven.io_grpc_grpc_auth'],
libraries['maven.io_grpc_grpc_protobuf'],
Expand All @@ -16,15 +16,15 @@ dependencies {
libraries['maven.com_google_api_grpc_proto_google_common_protos'],
libraries['maven.com_google_api_api_common'],
libraries['maven.io_grpc_grpc_netty_shaded'],
libraries['maven.io_grpc_grpc_alts']
libraries['maven.io_grpc_grpc_alts'])

compileOnly libraries['maven.com_google_auto_value_auto_value']

testCompile project(':gax').sourceSets.test.output,
testImplementation( project(':gax').sourceSets.test.output,
libraries['maven.junit_junit'],
libraries['maven.org_mockito_mockito_core'],
libraries['maven.com_google_truth_truth'],
libraries['maven.com_google_api_grpc_grpc_google_common_protos']
libraries['maven.com_google_api_grpc_grpc_google_common_protos'])

annotationProcessor libraries['maven.com_google_auto_value_auto_value']

Expand Down
10 changes: 5 additions & 5 deletions gax-httpjson/build.gradle
Expand Up @@ -4,7 +4,7 @@ archivesBaseName = "gax-httpjson"
project.version = "0.90.1-SNAPSHOT" // {x-version-update:gax-httpjson:current}

dependencies {
compile project(':gax'),
implementation( project(':gax'),
libraries['maven.com_google_protobuf'],
libraries['maven.com_google_protobuf_java_util'],
libraries['maven.com_google_code_gson_gson'],
Expand All @@ -15,15 +15,15 @@ dependencies {
libraries['maven.com_google_http_client_google_http_client_gson'],
libraries['maven.com_google_auth_google_auth_library_oauth2_http'],
libraries['maven.com_google_auth_google_auth_library_credentials'],
libraries['maven.com_google_api_grpc_proto_google_common_protos']
libraries['maven.com_google_api_api_common']
libraries['maven.com_google_api_grpc_proto_google_common_protos'],
libraries['maven.com_google_api_api_common'])

compileOnly libraries['maven.com_google_auto_value_auto_value']

testCompile project(':gax').sourceSets.test.output,
testImplementation( project(':gax').sourceSets.test.output,
libraries['maven.junit_junit'],
libraries['maven.org_mockito_mockito_core'],
libraries['maven.com_google_truth_truth']
libraries['maven.com_google_truth_truth'])

annotationProcessor libraries['maven.com_google_auto_value_auto_value']

Expand Down
8 changes: 4 additions & 4 deletions gax/build.gradle
Expand Up @@ -4,19 +4,19 @@ archivesBaseName = "gax"
project.version = "2.5.1-SNAPSHOT" // {x-version-update:gax:current}

dependencies {
compile libraries['maven.com_google_guava_guava'],
implementation (libraries['maven.com_google_guava_guava'],
libraries['maven.com_google_code_findbugs_jsr305'],
libraries['maven.org_threeten_threetenbp'],
libraries['maven.com_google_auth_google_auth_library_oauth2_http'],
libraries['maven.com_google_api_api_common'],
libraries['maven.io_opencensus_opencensus_api']
libraries['maven.io_opencensus_opencensus_api'])

compileOnly libraries['maven.com_google_auto_value_auto_value']

testCompile libraries['maven.junit_junit'],
testImplementation( libraries['maven.junit_junit'],
libraries['maven.org_mockito_mockito_core'],
libraries['maven.com_google_truth_truth'],
libraries['maven.com_google_auto_value_auto_value']
libraries['maven.com_google_auto_value_auto_value'] )

annotationProcessor libraries['maven.com_google_auto_value_auto_value']
testAnnotationProcessor libraries['maven.com_google_auto_value_auto_value']
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 0 additions & 2 deletions gradlew
Expand Up @@ -82,7 +82,6 @@ esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
Expand Down Expand Up @@ -130,7 +129,6 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand Down
22 changes: 18 additions & 4 deletions gradlew.bat
Expand Up @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand All @@ -54,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute
if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
Expand All @@ -64,14 +64,28 @@ echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
Expand Down

0 comments on commit d6b2f2f

Please sign in to comment.