Skip to content

Commit f6e0290

Browse files
friederbluemleddimtirov
authored andcommittedNov 5, 2019
Fix whitespace errors
1 parent c7a9daf commit f6e0290

File tree

5 files changed

+22
-21
lines changed

5 files changed

+22
-21
lines changed
 

‎.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ build/
55
*.iws
66

77
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
8-
!gradle-wrapper.jar
8+
!gradle-wrapper.jar

‎README.md

+18-16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# gwo-agent
2+
13
Have you ever needed to build a project using Gradle Wrapper pointing to distribution inaccessible through your company
24
firewall? Typically we modify the `wrapper.properties`, resulting in a "dirty" build, or ignore the Wrapper
35
altogether and build with a locally installed Gradle distribution.
@@ -9,37 +11,37 @@ giving you extra control over the build distribution, without modifying the chec
911

1012
All you need is to download the latest version [![Release](https://jitpack.io/v/ddimtirov/gwo-agent.svg)](https://jitpack.io/#ddimtirov/gwo-agent) or use `curl`:
1113

12-
````bash
14+
```sh
1315
curl -o gwo-agent.jar https://jitpack.io/com/github/ddimtirov/gwo-agent/1.2.0/gwo-agent-1.2.0.jar
14-
````
16+
```
1517

1618
And inject the agent into the Gradle wrapper using environment variable such as `GRADLE_OPTS`:
1719

18-
````bash
20+
```sh
1921
export GRADLE_OPTS=-javaagent:gwo-agent.jar=distributionUrl=https://mymirror/gradle-4.10-all.zip
20-
````
22+
```
2123

2224
Or in case of high security environments, specify the sha256 checksum too:
2325

24-
````bash
26+
```sh
2527
export GRADLE_OPTS=-javaagent:gwo-agent.jar=distributionUrl=https://mymirror/gradle-4.10-all.zip,distributionSha256Sum=371cb9fbebbe9880d147f59bab36d61eee122854ef8c9ee1ecf12b82368bcf10
26-
````
28+
```
2729

2830
Once this is done, you may use the standard agent and `gradlew` script as normal:
2931

30-
````bash
32+
```sh
3133
gradlew --version
3234
gradlew clean pub
33-
````
35+
```
3436

35-
***Note:*** If `GRADLE_OPTS` is already used by your build, you may as well use `JAVA_TOOL_OPTIONS` and `_JAVA_OPTIONS`,
37+
***Note:*** If `GRADLE_OPTS` is already used by your build, you may as well use `JAVA_TOOL_OPTIONS` and `_JAVA_OPTIONS`,
3638
though keep in mind these will impact any other Java process.
3739

3840
## Advanced usage
3941

4042
Often you would want to edit a small part of a property. For example:
41-
42-
````bash
43+
44+
```sh
4345
# replace a blacklisted Gradle version with a good one
4446
set GRADLE_OPTS=-javaagent:build/gwo-agent.jar=distributionUrl~=/4.10-bin/4.10.2-bin/
4547

@@ -48,7 +50,7 @@ set GRADLE_OPTS=-javaagent:build/gwo-agent.jar=distributionUrl~=/-([0-9\.]+)-(bi
4850

4951
# use same version from alternative download site
5052
set GRADLE_OPTS=-javaagent:build/gwo-agent.jar=distributionUrl~=@https://services.gradle.org/distributions@https://mymirror/gradle/@
51-
````
53+
```
5254

5355
In summary, the syntax for property transformation is:
5456

@@ -62,14 +64,14 @@ Especially with the transform options, sometimes we may want to get extra insigh
6264

6365
Set the `gwo.debug.resolution` JVM property to `true` to dump details about the properties which are handled by the agent.
6466

65-
````bash
67+
```sh
6668
> set GRADLE_OPTS=-Dgwo.debug.resolution=true -javaagent:build/gwo-agent.jar=distributionUrl~=/4.10.2-bin/4.10-bin/,distributionSha256Sum=abc123
6769

6870
> gradlew --version
6971
Transformed Gradle Wrapper property: distributionUrl = 'https://services.gradle.org/distributions/gradle-4.10.2-bin.zip' -> 'https://services.gradle.org/distributions/gradle-4.10-bin.zip'
7072
Overrode Gradle Wrapper property: distributionSha256Sum = 'abc123'
71-
````
73+
```
7274

73-
Finally, if you need to check whether the agent is instrumenting the right classes, set
74-
the `gwo.debug.instrumentation` JVM property to `true` to dump details about ByteBuddy's
75+
Finally, if you need to check whether the agent is instrumenting the right classes, set
76+
the `gwo.debug.instrumentation` JVM property to `true` to dump details about ByteBuddy's
7577
class inspection and instrumentation.

‎build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ publishing{
4545
project.shadow.component(publication)
4646
}
4747
}
48-
}
48+
}

‎settings.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
rootProject.name = 'gwo-agent'
2-
enableFeaturePreview('STABLE_PUBLISHING')
2+
enableFeaturePreview('STABLE_PUBLISHING')

‎src/main/java/io/github/ddimtirov/gradle/wrapperoverride/GradleWrapperOverrideAgent.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,4 @@ static void dumpException(
117117
}
118118
}
119119
}
120-
121-
}
120+
}

0 commit comments

Comments
 (0)
Please sign in to comment.