Skip to content

Commit

Permalink
Clean up gradle configs and update to gradle 7. (#1110)
Browse files Browse the repository at this point in the history
* Update gradle, fix gradle stuff so can now run on java 17. Fix versioning to be more in line with semver.

* Fix launcher run. Fix releaseJar. Fix release tools build.

* Fix maven publishing.

* Clean up build outputs.

* Re-indent files.

* Do not delete release directory when running other tasks.

* Implement gradle clean.

* Add `releaseVersion` command which tags the current version and update gh actions build.

* Remove markdown.pl. Update readme. Update build gradle.

* Fix launcher semver dependency.

* Fix JDK setup step name. Fix PR build naming.

* Update Gradle to 7.3.3.

* Add missing version.json to the standalone launcher

* Include lib subproject files in the chunky jar

* Fix gradle configuration as dependency warnings

Co-authored-by: Maik Marschner <[email protected]>
  • Loading branch information
ThatRedox and leMaik authored Mar 4, 2022
1 parent 5719d35 commit 349fe0a
Show file tree
Hide file tree
Showing 14 changed files with 464 additions and 1,877 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: 1.8
java-package: jdk+fx
distribution: 'temurin'
java-version: '17'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
Expand All @@ -36,14 +36,12 @@ jobs:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
if [[ "${GITHUB_EVENT_NAME}" != "pull_request" ]]; then
./gradlew build releasejar -PnewVersion="$(git describe)"
./gradlew buildReleaseJar
else
./gradlew build releasejar -PnewVersion="PR-${PR_NUMBER}_$(git describe)"
./gradlew buildReleaseJar -PprereleaseTag="PR.${PR_NUMBER}"
fi
- name: Cleanup
run: rm -rf build/docs build/tmp
- name: Upload build
uses: actions/[email protected]
with:
name: Chunky Build
path: build/
path: build/installer
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,23 @@ rendering tips are available at the [Chunky Documentation page][chunky-dev]. For

## Hacking on Chunky

To build Chunky, run the `gradlew` script in the project root directory: `./gradlew jar`

This just builds the core libraries. Building an installable file takes
a bit more work; [refer to this repository][chunky-releasetools].
It is recommended to use [IntelliJ](https://www.jetbrains.com/idea/).
Install the Java17 JDK ([Temurin](https://adoptium.net/) is the recomended distribution).
Then, [clone](https://www.jetbrains.com/help/idea/set-up-a-git-repository.html#clone-repo) the Chunky
repository and let IntelliJ index the project. Navigate to `chunky/src/java/se/llbit/chunky/main/Chunky.java` and
click on the green play button next to `public class Chunky {` to build and run Chunky.

To build Chunky externally, run the `gradlew` script in the project root directory. Gradle is setup with a few
main tasks:
* `build` - Build Chunky, documentation, and run tests.
* `release` - Build and save files ready for a release to a Chunky update site. Outputs to `build/release`
* `buildReleaseJar` - Build an installer JAR. Outputs to `build/installer`
* `docs` - Build the documentation. Outputs to `build/docs`
* `install` - Create a publishable maven repository for Chunky core. Outputs to `build/maven`
* `clean` - Cleans the project. Removes old builds.

A custom version can be specified with `-PnewVersion="<version>"`. A custom prerelease tag can be specified with
`-PprereleaseTag="<tag>"`. The default version is in the format: `{major}.{minor}.{patch}-{tag (DEV)}.{commits since last tag}.g{git hash of commit}`

Chunky is split into four subprojects:

Expand Down Expand Up @@ -175,9 +188,6 @@ the GPLv3 license. See the file `LICENSE` for the full license.

Chunky uses the following 3rd party libraries:

* **Markdown by John Gruber.**
Markdown is covered by the Modified BSD License.
See the file `licenses/Markdown.txt` for the full license and copyright notice.
* **Apache Commons Math library by the Apache Software Foundation.**
The library is covered by the Apache License, version 2.0.
See the file `licenses/Apache-2.0.txt` for the full license text.
Expand Down
Loading

0 comments on commit 349fe0a

Please sign in to comment.