Skip to content

Commit 1df72d2

Browse files
jinseopkim0alicejlimpeddada1renovate-botrelease-please[bot]
authored
chore: migrate java-shared-config to monorepo (#13481)
b/519273974 --------- Co-authored-by: Alice <65933803+alicejli@users.noreply.github.com> Co-authored-by: Mridula <66699525+mpeddada1@users.noreply.github.com> Co-authored-by: Mend Renovate <bot@renovateapp.com> Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Min Zhu <zhumin@google.com> Co-authored-by: Tomo Suzuki <suztomo@gmail.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Burke Davison <40617934+burkedavison@users.noreply.github.com> Co-authored-by: Diego Marquez <diegomarquezp@google.com> Co-authored-by: gcf-owl-bot[bot] <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Lawrence Qiu <lawrenceqiu@google.com> Co-authored-by: Mike Eltsufin <meltsufin@google.com> Co-authored-by: Joe Wang <106995533+JoeWang1127@users.noreply.github.com> Co-authored-by: ldetmer <1771267+ldetmer@users.noreply.github.com> Co-authored-by: Blake Li <blakeli@google.com>
1 parent 75eae36 commit 1df72d2

45 files changed

Lines changed: 3598 additions & 64 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@
2020
/java-bigtable/ @googleapis/bigtable-team @googleapis/cloud-sdk-java-team @googleapis/cloud-sdk-librarian-team
2121
/java-firestore/ @googleapis/firestore-team @googleapis/cloud-sdk-java-team @googleapis/cloud-sdk-librarian-team
2222
/librarian.yaml @googleapis/cloud-sdk-java-team @googleapis/cloud-sdk-librarian-team
23+
/java-shared-config/ @googleapis/cloud-sdk-java-team @googleapis/cloud-sdk-librarian-team

.github/workflows/ci.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ jobs:
4646
workflows:
4747
- '.github/workflows/**'
4848
src:
49-
- '!(google-auth-library-java|grpc-gcp-java|java-bigquery|java-bigquery-jdbc|java-bigquerystorage|java-bigtable|java-datastore|java-firestore|java-logging|java-logging-logback|java-pubsub|java-spanner|java-storage)/**/*.java'
50-
- '!(google-auth-library-java|grpc-gcp-java|java-bigquery|java-bigquery-jdbc|java-bigquerystorage|java-bigtable|java-datastore|java-firestore|java-logging|java-logging-logback|java-pubsub|java-spanner|java-storage)/**/pom.xml'
49+
- '!(google-auth-library-java|grpc-gcp-java|java-bigquery|java-bigquery-jdbc|java-bigquerystorage|java-bigtable|java-datastore|java-firestore|java-logging|java-logging-logback|java-pubsub|java-shared-config|java-spanner|java-storage)/**/*.java'
50+
- '!(google-auth-library-java|grpc-gcp-java|java-bigquery|java-bigquery-jdbc|java-bigquerystorage|java-bigtable|java-datastore|java-firestore|java-logging|java-logging-logback|java-pubsub|java-shared-config|java-spanner|java-storage)/**/pom.xml'
5151
- 'pom.xml'
5252
ci:
5353
- '.github/workflows/ci.yaml'
@@ -219,6 +219,8 @@ jobs:
219219
- 'sdk-platform-java/**/*.java'
220220
- 'sdk-platform-java/java-shared-dependencies/**/pom.xml'
221221
- 'sdk-platform-java/gapic-generator-java-pom-parent/pom.xml'
222+
java-shared-config:
223+
- 'java-shared-config/**'
222224
split-units:
223225
runs-on: ubuntu-latest
224226
needs: changes
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# Github action job to test core java library features on
15+
# downstream client libraries before they are released.
16+
on:
17+
push:
18+
branches:
19+
- main
20+
pull_request:
21+
name: java-shared-config ci
22+
env:
23+
BUILD_SUBDIR: java-shared-config
24+
jobs:
25+
filter:
26+
runs-on: ubuntu-latest
27+
outputs:
28+
library: ${{ steps.filter.outputs.library }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: dorny/paths-filter@v3
32+
id: filter
33+
with:
34+
filters: |
35+
library:
36+
- 'java-shared-config/**'
37+
units:
38+
needs: filter
39+
if: ${{ needs.filter.outputs.library == 'true' }}
40+
runs-on: ubuntu-latest
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
java: [11, 17, 21]
45+
steps:
46+
- uses: actions/checkout@v4
47+
- uses: actions/setup-java@v4
48+
with:
49+
distribution: temurin
50+
java-version: ${{matrix.java}}
51+
- run: java -version
52+
- run: .kokoro/build.sh
53+
env:
54+
JOB_TYPE: test
55+
units-java8:
56+
needs: filter
57+
if: ${{ needs.filter.outputs.library == 'true' }}
58+
# Building using Java 17 and run the tests with Java 8 runtime
59+
name: "units (8)"
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v4
63+
- uses: actions/setup-java@v4
64+
with:
65+
java-version: 11
66+
distribution: temurin
67+
- name: "Set jvm system property environment variable for surefire plugin (unit tests)"
68+
# Maven surefire plugin (unit tests) allows us to specify JVM to run the tests.
69+
# https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm
70+
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java -P !java17" >> $GITHUB_ENV
71+
shell: bash
72+
- uses: actions/setup-java@v4
73+
with:
74+
java-version: 17
75+
distribution: temurin
76+
- run: .kokoro/build.sh
77+
env:
78+
JOB_TYPE: test
79+
windows:
80+
needs: filter
81+
if: ${{ needs.filter.outputs.library == 'true' }}
82+
runs-on: windows-latest
83+
steps:
84+
- name: Support longpaths
85+
run: git config --system core.longpaths true
86+
- uses: actions/checkout@v4
87+
- uses: actions/setup-java@v4
88+
with:
89+
distribution: temurin
90+
java-version: 11
91+
- run: java -version
92+
- run: .kokoro/build.sh
93+
env:
94+
JOB_TYPE: test
95+
dependencies:
96+
needs: filter
97+
if: ${{ needs.filter.outputs.library == 'true' }}
98+
runs-on: ubuntu-latest
99+
strategy:
100+
matrix:
101+
java: [17]
102+
steps:
103+
- uses: actions/checkout@v4
104+
- uses: actions/setup-java@v4
105+
with:
106+
distribution: temurin
107+
java-version: ${{matrix.java}}
108+
- run: java -version
109+
- run: .kokoro/dependencies.sh
110+
javadoc:
111+
needs: filter
112+
if: ${{ needs.filter.outputs.library == 'true' }}
113+
runs-on: ubuntu-latest
114+
steps:
115+
- uses: actions/checkout@v4
116+
- uses: actions/setup-java@v4
117+
with:
118+
distribution: temurin
119+
java-version: 17
120+
- run: java -version
121+
- run: .kokoro/build.sh
122+
env:
123+
JOB_TYPE: javadoc
124+
lint:
125+
needs: filter
126+
if: ${{ needs.filter.outputs.library == 'true' }}
127+
runs-on: ubuntu-latest
128+
steps:
129+
- uses: actions/checkout@v4
130+
with:
131+
fetch-depth: 0
132+
- uses: actions/setup-java@v4
133+
with:
134+
distribution: temurin
135+
java-version: 11
136+
- run: java -version
137+
- run: .kokoro/build.sh
138+
env:
139+
JOB_TYPE: lint
140+
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
141+
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
142+
clirr:
143+
needs: filter
144+
if: ${{ needs.filter.outputs.library == 'true' }}
145+
runs-on: ubuntu-latest
146+
steps:
147+
- uses: actions/checkout@v4
148+
- uses: actions/setup-java@v4
149+
with:
150+
distribution: temurin
151+
java-version: 11
152+
- run: java -version
153+
- run: .kokoro/build.sh
154+
env:
155+
JOB_TYPE: clirr
156+
BUILD_SUBDIR: java-shared-config
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
name: java-shared-config downstream (dependencies)
7+
env:
8+
BUILD_SUBDIR: java-shared-config
9+
jobs:
10+
filter:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
library: ${{ steps.filter.outputs.library }}
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: dorny/paths-filter@v3
17+
id: filter
18+
with:
19+
filters: |
20+
library:
21+
- 'java-shared-config/**'
22+
dependencies:
23+
needs: filter
24+
if: ${{ needs.filter.outputs.library == 'true' }}
25+
runs-on: ubuntu-latest
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
java: [11]
30+
repo:
31+
- java-bigquery
32+
- java-bigquerystorage
33+
- java-spanner
34+
- java-storage
35+
- java-pubsub
36+
steps:
37+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
38+
- uses: actions/setup-java@v4
39+
with:
40+
distribution: zulu
41+
java-version: ${{matrix.java}}
42+
- run: java -version
43+
- run: sudo apt-get update -y
44+
- run: sudo apt-get install libxml2-utils
45+
- name: Install java-shared-dependencies and common dependencies
46+
run: |
47+
.kokoro/build.sh
48+
env:
49+
JOB_TYPE: install
50+
- name: Pre-build dependencies
51+
run: |
52+
LIB_DIR="${{matrix.repo}}"
53+
LIB_NAME="google-cloud-${LIB_DIR#java-}"
54+
TARGET_PATH="${LIB_DIR}/${LIB_NAME}"
55+
# Check if target matches standard structure (e.g. java-bigquery/google-cloud-bigquery)
56+
if [ ! -d "${TARGET_PATH}" ]; then
57+
# Fallback 1: Look for any google-cloud-* directory, excluding samples, retrofit, or BOMs (e.g. java-storage-nio/google-cloud-nio)
58+
ALT_PATH=$(find "${LIB_DIR}" -maxdepth 1 -type d -name "google-cloud-*" ! -name "*-bom" ! -name "*-parent" ! -name "*-deps-bom" ! -name "*-examples" ! -name "*samples" ! -name "*-retrofit" | head -n 1)
59+
if [ -n "${ALT_PATH}" ]; then
60+
TARGET_PATH="${ALT_PATH}"
61+
else
62+
# Fallback 2: Assume single-module project where pom.xml is in the root directory (e.g. java-logging-logback)
63+
TARGET_PATH="${LIB_DIR}"
64+
fi
65+
fi
66+
mvn install -pl ${TARGET_PATH} -am -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V -q
67+
- run: .kokoro/client-library-check.sh ${{matrix.repo}} dependencies
68+
69+
flatten-plugin-check:
70+
needs: filter
71+
if: ${{ needs.filter.outputs.library == 'true' }}
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
75+
- uses: actions/setup-java@v4
76+
with:
77+
distribution: zulu
78+
java-version: 11
79+
- run: java -version
80+
- run: sudo apt-get update -y
81+
- run: sudo apt-get install libxml2-utils
82+
- name: Install java-shared-dependencies and common dependencies
83+
run: |
84+
.kokoro/build.sh
85+
env:
86+
JOB_TYPE: install
87+
- name: Pre-build dependencies
88+
run: mvn install -pl java-storage/google-cloud-storage -am -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V -q
89+
- run: .kokoro/client-library-check.sh java-storage flatten-plugin
90+
env:
91+
EXPECTED_DEPENDENCIES_LIST: java-storage-expected-flattened-dependencies.txt

0 commit comments

Comments
 (0)