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

Add documentation for gradle-wrapper.properties binding #585

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .github/workflows/java-gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ jobs:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('java/gradle/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- run: ./gradlew build
# simulate the bindings
- run: cp bindings/gradle-wrapper/gradle-wrapper.properties gradle/wrapper/gradle-wrapper.properties && ./gradlew build
working-directory: java/gradle
18 changes: 13 additions & 5 deletions java/gradle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,30 @@ See [prerequisites](https://paketo.io/docs/howto/java/#prerequisites) of this sa
## Building

```bash
pack build applications/gradle --env BP_JVM_VERSION=17
pack build applications/gradle
```

Alternatively, if you want to attach a `gradle.properties` file to pass additional configuration to Gradle.
Alternatively, if you want to attach a `gradle.properties` and/or a `gradle-wrapper.properties` file to pass additional configuration to Gradle (Wrapper).

```bash
pack build applications/gradle --volume $(pwd)/bindings:/platform/bindings --env BP_JVM_VERSION=17
pack build applications/gradle --volume $(pwd)/bindings:/platform/bindings
```

The command above will use the sample `gradle.properties` file from this repo. It may be more useful to copy your local `gradle.properties` file first.
The command above will use:

* the sample `gradle.properties` file from this repo. It may be more useful to copy your local `gradle.properties` file first.

```bash
cp ~/.gradle/gradle.properties java/gradle/bindings/gradle/gradle.properties
pack build applications/gradle --volume $(pwd)/bindings:/platform/bindings --env BP_JVM_VERSION=17
pack build applications/gradle --volume $(pwd)/bindings:/platform/bindings
```

* the sample `gradle-wrapper.properties` file from this repo. It may be more useful to copy your local `gradle-wrapper.properties` file first.

```bash
cp ~/gradle/wrapper/gradle-wrapper.properties java/gradle/bindings/gradle-wrapper/gradle-wrapper.properties
pack build applications/gradle --volume $(pwd)/bindings:/platform/bindings

## Running

```bash
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
networkTimeout=60000
1 change: 1 addition & 0 deletions java/gradle/bindings/gradle-wrapper/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gradle-wrapper
4 changes: 2 additions & 2 deletions java/gradle/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
networkTimeout=10000
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
networkTimeout=1
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 4 additions & 0 deletions java/gradle/smoke_test/gradle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ func testGradleWithBuilder(builder string) func(*testing.T, spec.G, spec.S) {
}).
WithBuilder(builder).
WithGID("123").
WithEnv(map[string]string{
"SERVICE_BINDING_ROOT": "/bindings",
}).
WithVolumes(fmt.Sprintf("%s:/bindings/gradle-wrapper", filepath.Join(source, "bindings/gradle-wrapper"))).
Execute(name, source)
Expect(err).ToNot(HaveOccurred(), logs.String)

Expand Down
Loading