Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: set up fully working Maven pom.xml #937

Merged
merged 27 commits into from
Feb 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
92e008d
chore: Maven PoC (phase 1)
chanseokoh Feb 2, 2022
0c89c21
chore: add target/ to .gitignore
chanseokoh Feb 2, 2022
8068a62
chore: add comment
chanseokoh Feb 2, 2022
80115af
chore: clean up Bazel
chanseokoh Feb 2, 2022
7d0aa14
chore: clean up Bazel
chanseokoh Feb 2, 2022
c04b87b
chore: migrate google-java-format
chanseokoh Feb 2, 2022
7c36353
chore: make test work / more cleanups
chanseokoh Feb 3, 2022
1318db4
chore: fix generation
chanseokoh Feb 3, 2022
8a19929
Merge branch 'main' into maven-poc
chanseokoh Feb 8, 2022
be52ba6
chore: fix things after merge with main
chanseokoh Feb 8, 2022
02585df
chore: wip
chanseokoh Feb 8, 2022
cb54256
chore: wip
chanseokoh Feb 8, 2022
ba0494a
chore: enable updating unit golden files
chanseokoh Feb 8, 2022
06fe27a
Merge branch 'main' into maven-poc
chanseokoh Feb 8, 2022
df22610
Merge branch 'main' into maven-poc
chanseokoh Feb 16, 2022
9e814a2
chore: wip
chanseokoh Feb 16, 2022
9bee687
chore: update SubscriberClientTest.golden
chanseokoh Feb 16, 2022
2ce3410
chore: migrate format
chanseokoh Feb 16, 2022
6e5785e
chore: wip
chanseokoh Feb 16, 2022
f617dc2
chore: wip
chanseokoh Feb 16, 2022
024e0fd
chore: add javax.annotation-api for Java 11 build
chanseokoh Feb 16, 2022
45d68eb
chore: re-work Bazel build infrastructure
chanseokoh Feb 16, 2022
7ef9a38
chore: re-work build infra
chanseokoh Feb 16, 2022
1297100
chore: set up fully working pom.xml
chanseokoh Feb 17, 2022
fd7ef5f
chore: update DEVELOPMENT.md
chanseokoh Feb 17, 2022
c1d184b
chore: remove version for javax.annotation-api
chanseokoh Feb 17, 2022
6076ff6
Merge branch 'main' into setup-maven
chanseokoh Feb 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/ci-maven.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
push:
branches:
- main
pull_request:
name: ci-maven
jobs:
build:
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: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: Unit Tests
run: |
mvn verify --batch-mode --no-transfer-progress

- name: Java Linter
run: mvn fmt:check
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Bazel.
bazel-*
.gradle/
target/

# IDE
.idea
Expand Down
32 changes: 30 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,20 @@
```sh
bazel run //:google_java_format_verification
```
or
```sh
mvn fmt:check
```

- Format files.

```sh
bazel run //:google_java_format
```
or
```sh
mvn fmt:format
```

## Test Running

Expand All @@ -112,18 +120,38 @@
```sh
bazel test //:units
```
or
```sh
mvn test
```

- Run a single unit test like `JavaCodeGeneratorTest.java`
- Run a single unit test like `JavaCodeGeneratorTest.java`:

```sh
bazel test //:unit_com_google_api_generator_engine_JavaCodeGeneratorTest
```
or
```sh
mvn test -Dtest=JavaCodeGeneratorTest

mvn test "-Dtest=Basic*, !%regex[.*.Unstable.*], !%regex[.*.MyTest.class#one.*|two.*], %regex[#fast.*|slow.*]"
```
- Update all unit test golden files:

- Update unit test golden files, for example `JavaCodeGeneratorTest.java`:
```sh
mvn test -DupdateUnitGoldens
```

- Update a single unit test golden file, for example `JavaCodeGeneratorTest.java`:

```sh
bazel run //:update_com_google_api_generator_engine_JavaCodeGeneratorTest
```
or
```sh
mvn test -DupdateUnitGoldens -Dtest=JavaCodeGeneratorTest
```

- Run a single integration test for API like `Redis`, it generates Java source
code using the Java microgenerator and compares them with the goldens files
Expand Down
Loading