GRADLE - s50600822/Notes GitHub Wiki
Version
https://docs.gradle.org/current/userguide/compatibility.html
Plugin
Gradle Plugins
Contribute
https://plugins.gradle.org/docs/publish-plugin
Inferred versioning
Don't know who smoked what and come up with this idea. If you have a shallow clone, it's very bad:
2023-09-21T14:57:37.360+1000 [DEBUG] [org.eclipse.jgit.internal.storage.file.FileSnapshot] file=/Users/hoaphan/.gitconfig, is unmodified
2023-09-21T14:57:37.360+1000 [DEBUG] [org.eclipse.jgit.internal.storage.file.FileSnapshot] file=/Users/hoaphan/dev/code/conductor/.git/config, isRacyClean=false, read=2023-09-21 14:57:37.175419000, lastModified=2023-09-21 14:55:41.564851998, delta=115610567002 ns, racy<=2500000000 ns
2023-09-21T14:57:37.360+1000 [DEBUG] [org.eclipse.jgit.internal.storage.file.FileSnapshot] file=/Users/hoaphan/dev/code/conductor/.git/config, is unmodified
2023-09-21T14:57:37.361+1000 [WARN] [nebula.plugin.release.git.semver.SemVerStrategy] Inferred project: conductor, version: 3.14.0-SNAPSHOT
2023-09-21T14:57:37.361+1000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Execute container callback action' completed
2023-09-21T14:57:37.361+1000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Execute container callback action' completed
Scrap all gradle binaries(to populate your private repo)
import requests
from bs4 import BeautifulSoup
"""
pip3 install requests beautifulsoup4
"""
vgm_url = 'https://services.gradle.org/distributions'
html_text = requests.get(vgm_url).text
soup = BeautifulSoup(html_text, 'html.parser')
for link in soup.find_all('a'):
artifact = link.get('href')
if artifact not in ('', '/', '/distributions'):
print(artifact)
url = "https://services.gradle.org/distributions{}".format(artifact)
file = "./downloads{}".format(artifact)
print('Downloaded: {} ---> {}'.format(url, file))
r = requests.get(url, allow_redirects=True)
with open(file, 'wb') as f:
f.write(r.content)
DEBUG
Gradle
./gradlew build -xtest -Dorg.gradle.debug=true
./gradlew build -xtest -Dorg.gradle.jvmargs='-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=5005,suspend=y'
!!! NOTE THAT: this option will not pause and wait for remote debugger if the port is already occupied (don't ask why) You can check and free the port if necessary before attempt the debug:
lsof -i:5005
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 6535 hoaphan 6u IPv4 0xd92e38058d57f939 0t0 TCP localhost:avt-profile-2 (LISTEN)
Test
Note that this is different from the above debugging
./gradlew :conductor-http-task:test --no-build-cache
./gradlew :conductor-http-task:test --tests HttpTaskTest.testHTTPGetConnectionTimeOut -i
./gradlew :conductor-java-sdk:test --tests WorkflowCreationTests --debug-jvm
Community
Ref
https://blog.gradle.org/alignment-with-gradle-module-metadata
JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -verbose"
$JAVA_OPTS="$JAVA_OPTS -verbose "
$GRADLE_OPTS="$GRADLE_OPTS -verbose "