Skip to content

Commit

Permalink
all: fix publish not having checksum (#5398)
Browse files Browse the repository at this point in the history
  • Loading branch information
creamsoup committed Feb 27, 2019
1 parent 77af87c commit 44c98e8
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
32 changes: 18 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -403,22 +403,26 @@ subprojects {
}
repositories {
maven {
String stagingUrl
if (rootProject.hasProperty('repositoryId')) {
stagingUrl = 'https://oss.sonatype.org/service/local/staging/deployByRepositoryId/' +
rootProject.repositoryId
if (rootProject.hasProperty('repositoryDir')) {
url = new File(rootProject.repositoryDir).toURI()
} else {
stagingUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
}
credentials {
if (rootProject.hasProperty('ossrhUsername') && rootProject.hasProperty('ossrhPassword')) {
username = rootProject.ossrhUsername
password = rootProject.ossrhPassword
String stagingUrl
if (rootProject.hasProperty('repositoryId')) {
stagingUrl = 'https://oss.sonatype.org/service/local/staging/deployByRepositoryId/' +
rootProject.repositoryId
} else {
stagingUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
}
}
def releaseUrl = stagingUrl
def snapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotUrl : releaseUrl
credentials {
if (rootProject.hasProperty('ossrhUsername') && rootProject.hasProperty('ossrhPassword')) {
username = rootProject.ossrhUsername
password = rootProject.ossrhPassword
}
}
def releaseUrl = stagingUrl
def snapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotUrl : releaseUrl
}
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions buildscripts/kokoro/unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ fi
LOCAL_MVN_TEMP=$(mktemp -d)
# Note that this disables parallel=true from GRADLE_FLAGS
if [[ -z "${ALL_ARTIFACTS:-}" ]]; then
./gradlew grpc-compiler:build grpc-compiler:publishToMavenLocal $GRADLE_FLAGS \
-Dorg.gradle.parallel=false -Dmaven.repo.local=$LOCAL_MVN_TEMP
./gradlew grpc-compiler:build grpc-compiler:publish $GRADLE_FLAGS \
-Dorg.gradle.parallel=false -PrepositoryDir=$LOCAL_MVN_TEMP
else
./gradlew publishToMavenLocal $GRADLE_FLAGS \
-Dorg.gradle.parallel=false -Dmaven.repo.local=$LOCAL_MVN_TEMP
./gradlew publish $GRADLE_FLAGS \
-Dorg.gradle.parallel=false -PrepositoryDir=$LOCAL_MVN_TEMP
fi

readonly MVN_ARTIFACT_DIR="${MVN_ARTIFACT_DIR:-$GRPC_JAVA_DIR/mvn-artifacts}"
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/kokoro/windows32.bat
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ IF NOT %GRADLEEXIT% == 0 (
@rem make sure no daemons have any files open
cmd.exe /C "%WORKSPACE%\gradlew.bat --stop"

cmd.exe /C "%WORKSPACE%\gradlew.bat %GRADLE_FLAGS% -Dorg.gradle.parallel=false -Dmaven.repo.local=%WORKSPACE%\artifacts clean grpc-compiler:build grpc-compiler:publishToMavenLocal" || exit /b 1
cmd.exe /C "%WORKSPACE%\gradlew.bat %GRADLE_FLAGS% -Dorg.gradle.parallel=false -PrepositoryDir=%WORKSPACE%\artifacts clean grpc-compiler:build grpc-compiler:publish" || exit /b 1
2 changes: 1 addition & 1 deletion buildscripts/kokoro/windows64.bat
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ SET GRADLE_FLAGS=-PtargetArch=%TARGET_ARCH% -PfailOnWarnings=%FAIL_ON_WARNINGS%
@rem make sure no daemons have any files open
cmd.exe /C "%WORKSPACE%\gradlew.bat --stop"

cmd.exe /C "%WORKSPACE%\gradlew.bat %GRADLE_FLAGS% -Dorg.gradle.parallel=false -Dmaven.repo.local=%WORKSPACE%\artifacts clean grpc-compiler:build grpc-compiler:publishToMavenLocal" || exit /b 1
cmd.exe /C "%WORKSPACE%\gradlew.bat %GRADLE_FLAGS% -Dorg.gradle.parallel=false -PrepositoryDir=%WORKSPACE%\artifacts clean grpc-compiler:build grpc-compiler:publish" || exit /b 1

0 comments on commit 44c98e8

Please sign in to comment.