Skip to content

Commit

Permalink
chore: use java helper for templates (#195)
Browse files Browse the repository at this point in the history
b0ffd0b
commit b0ffd0b
Author: Jeff Ching <chingor@google.com>
Date:   Wed Mar 18 17:04:08 2020 -0700

    chore: use java helper for templates (#195)

    We are cleaning up usage of common templates in synthtool. This allows us the cleanup usage in a centralized place rather than in 60+ repos
  • Loading branch information
yoshi-automation committed Mar 30, 2020
1 parent dd769c4 commit cfdc2e6
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 96 deletions.
19 changes: 7 additions & 12 deletions .kokoro/build.sh
Expand Up @@ -20,22 +20,17 @@ scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
## cd to the parent directory, i.e. the root of the git repo
cd ${scriptDir}/..

# include common functions
source ${scriptDir}/common.sh

# Print out Java version
java -version
echo ${JOB_TYPE}

# attempt to install 3 times with exponential backoff (starting with 10 seconds)
retry_with_backoff 3 10 \
mvn install -B -V \
-DskipTests=true \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true \
-T 1C
mvn install -B -V \
-DskipTests=true \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true \
-T 1C

# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it
if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then
Expand Down
44 changes: 0 additions & 44 deletions .kokoro/common.sh

This file was deleted.

15 changes: 4 additions & 11 deletions .kokoro/dependencies.sh
Expand Up @@ -15,13 +15,7 @@

set -eo pipefail

## Get the directory of the build script
scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
## cd to the parent directory, i.e. the root of the git repo
cd ${scriptDir}/..

# include common functions
source ${scriptDir}/common.sh
cd github/java-storage/

# Print out Java
java -version
Expand All @@ -30,9 +24,8 @@ echo $JOB_TYPE
export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m"

# this should run maven enforcer
retry_with_backoff 3 10 \
mvn install -B -V \
-DskipTests=true \
-Dclirr.skip=true
mvn install -B -V \
-DskipTests=true \
-Dclirr.skip=true

mvn -B dependency:analyze -DfailOnWarning=true
22 changes: 7 additions & 15 deletions .kokoro/linkage-monitor.sh
Expand Up @@ -17,26 +17,18 @@ set -eo pipefail
# Display commands being run.
set -x

## Get the directory of the build script
scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
## cd to the parent directory, i.e. the root of the git repo
cd ${scriptDir}/..

# include common functions
source ${scriptDir}/common.sh
cd github/java-storage/

# Print out Java version
java -version
echo ${JOB_TYPE}

# attempt to install 3 times with exponential backoff (starting with 10 seconds)
retry_with_backoff 3 10 \
mvn install -B -V \
-DskipTests=true \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true
mvn install -B -V \
-DskipTests=true \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true

# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR
JAR=linkage-monitor-latest-all-deps.jar
Expand Down
6 changes: 2 additions & 4 deletions renovate.json
Expand Up @@ -56,9 +56,7 @@
},
{
"packagePatterns": [
"^com.google.cloud:google-cloud-storage",
"^com.google.cloud:libraries-bom",
"^com.google.cloud.samples:shared-configuration"
"^com.google.cloud:libraries-bom"
],
"semanticCommitType": "chore",
"semanticCommitScope": "deps"
Expand All @@ -77,4 +75,4 @@
}
],
"semanticCommits": true
}
}
10 changes: 5 additions & 5 deletions synth.metadata
@@ -1,11 +1,11 @@
{
"updateTime": "2020-03-30T22:54:26.936389Z",
"updateTime": "2020-03-17T18:53:43.239577Z",
"sources": [
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "a003d8655d3ebec2bbbd5fc3898e91e152265c67"
"template": {
"name": "java_library",
"origin": "synthtool.gcp",
"version": "2020.2.4"
}
}
]
Expand Down
7 changes: 2 additions & 5 deletions synth.py
Expand Up @@ -14,12 +14,9 @@

"""This script is used to synthesize generated parts of this library."""

import synthtool as s
import synthtool.gcp as gcp
import synthtool.languages.java

common_templates = gcp.CommonTemplates()
templates = common_templates.java_library()
s.copy(templates, excludes=[
java.common_templates(excludes=[
'README.md',
'.kokoro/presubmit/integration.cfg'
])
Expand Down

0 comments on commit cfdc2e6

Please sign in to comment.