Skip to content

Commit

Permalink
Pages plugin version 0.2, set java compilation target to 8, fix `aarc…
Browse files Browse the repository at this point in the history
…h64` de-normalization
  • Loading branch information
hanggrian committed Aug 19, 2024
1 parent ad69eb6 commit 93c4282
Show file tree
Hide file tree
Showing 42 changed files with 1,105 additions and 758 deletions.
18 changes: 18 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2.1

executors:
linux:
docker:
- image: cimg/openjdk:21.0

jobs:
unit-test:
executor: linux
steps:
- checkout
- run: ./gradlew test

workflows:
build:
jobs:
- unit-test
13 changes: 11 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,14 @@ max_line_length = 80
[*.{kt,kts}]
indent_size = 4
max_line_length = 100
ktlint_standard_trailing-comma-on-call-site = disabled
ktlint_standard_trailing-comma-on-declaration-site = disabled
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
ij_kotlin_name_count_to_use_star_import = 2147483647
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
ij_kotlin_packages_to_use_import_on_demand = unset
ktlint_class_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = unset
ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = unset
ktlint_chain_method_rule_force_multiline_when_chain_operator_count_greater_or_equal_than = unset

[*.gradle]
indent_size = 4
max_line_length = 100
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# macOS
**/.DS_Store
.DS_Store
._*

# Gradle
.gradle/
Expand All @@ -10,3 +11,6 @@ local.properties
*.iml
.idea/
out/

# VSCode
bin/
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

44 changes: 10 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Travis CI](https://img.shields.io/travis/com/hendraanggrian/packaging-gradle-plugin)](https://travis-ci.com/github/hendraanggrian/packaging-gradle-plugin/)
[![Plugin Portal](https://img.shields.io/maven-metadata/v.svg?label=plugin-portal&metadataUrl=https%3A%2F%2Fplugins.gradle.org%2Fm2%2Fcom%2Fhendraanggrian%2Fpackaging%2Fcom.hendraanggrian.packaging.gradle.plugin%2Fmaven-metadata.xml)](https://plugins.gradle.org/plugin/com.hendraanggrian.packaging)
[![OpenJDK](https://img.shields.io/badge/jdk-17%2B-informational)](https://openjdk.java.net/projects/jdk/17/)
[![CircleCI](https://img.shields.io/circleci/build/gh/hanggrian/packaging-gradle-plugin)](https://app.circleci.com/pipelines/github/hanggrian/packaging-gradle-plugin/)
[![Plugin Portal](https://img.shields.io/gradle-plugin-portal/v/com.hanggrian.packaging)](https://plugins.gradle.org/plugin/com.hanggrian.packaging)
[![Java](https://img.shields.io/badge/java-17+-informational)](https://docs.oracle.com/javase/17/)

# Packaging Gradle Plugin

Expand All @@ -9,18 +9,13 @@ Gradle plugin that wraps JARs into native bundle for Windows, macOS, and Linux.
- Complete customization for each distribution.
- Pack multiple distributions with a single task.

| Version | Method |
| --- | --- |
| 0.1 | [packr](https://github.com/libgdx/packr/) |
| 0.2+ | [jpackage](https://docs.oracle.com/en/java/javase/14/jpackage/packaging-overview.html) |

## Download

Using plugins DSL:

```gradle
plugins {
id('com.hendraanggrian.packaging') version "$version"
id('com.hanggrian.packaging') version "$version"
}
```

Expand All @@ -32,11 +27,11 @@ buildscript {
gradlePluginPortal()
}
dependencies {
classpath("com.hendraanggrian:packaging-gradle-plugin:$version")
classpath("com.hanggrian:packaging-gradle-plugin:$version")
}
}
apply plugin: 'com.hendraanggrian.packaging'
apply plugin: 'com.hanggrian.packaging'
```

## Usage
Expand All @@ -47,30 +42,11 @@ configuration.

```gradle
packaging {
executable.set('example')
classpath.set(new File('path/to/jar'))
appName.set('Custom Directory')
mainClass.set('com.example.App')
vmArgs.addAll('-Xmx1G')
resources.addAll(new File('image.jpg'), new File('path/to/other.jpg'))
minimizeJre.set('hard')
outputDirectory.set(new File('my/folder'))
modules = ['javafx.controls', 'javafx.graphics']
modulePaths.add(new File('/path/to/javafx-sdk/lib'))
verbose.set(true)
autoOpen.set(true)
}
tasks {
packWindows64 {
executable.set('example64')
vmArgs.add('-Xdebug')
appName.set('Example Windows 64-bit')
jdk.set('path/to/windows_64_jdk')
}
packMacOS {
name.set('Example.app')
jdk.set('path/to/mac_jdk')
icon.set(new File('path/to/mac_icon.icns'))
bundleId.set('com.example.app')
}
}
```

Expand All @@ -81,7 +57,7 @@ with `installDist` command.

```gradle
apply plugin: 'application'
apply plugin: 'com.hendraanggrian.packaging'
apply plugin: 'com.hanggrian.packaging'
application {
applicationName = 'My App'
Expand Down
7 changes: 5 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
val releaseGroup: String by project
val releaseVersion: String by project

allprojects {
group = RELEASE_GROUP
version = RELEASE_VERSION
group = releaseGroup
version = releaseVersion
}
9 changes: 0 additions & 9 deletions buildSrc/build.gradle.kts

This file was deleted.

52 changes: 0 additions & 52 deletions buildSrc/src/KtLint.kt

This file was deleted.

9 changes: 0 additions & 9 deletions buildSrc/src/Releases.kt

This file was deleted.

11 changes: 9 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Gradle
developerId=hanggrian
developerName=Hendra Anggrian
developerUrl=https://github.com/hanggrian/
releaseGroup=com.hanggrian.packaging
releaseArtifact=packaging-gradle-plugin
releaseVersion=0.1
releaseDescription=Start making native distributions for your JAR
releaseUrl=https://github.com/hanggrian/packaging-gradle-plugin/

org.gradle.parallel=true
org.gradle.jvmargs=-Xmx2g -Dfile.encoding=UTF-8

# IDEA
kotlin.code.style=official
21 changes: 10 additions & 11 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
[versions]
jdk = "17"
kotlin = "1.8.10"
ktor = "1.6.7"
jdk = "21"
jre = "17"
kotlin = "1.9.20"
ktlint = "1.3.1"

[plugins]
dokka = { id = "org.jetbrains.dokka", version.ref = "kotlin" }
kotlinx-kover = "org.jetbrains.kotlinx.kover:0.6.1"
gradle-publish = "com.gradle.plugin-publish:1.1.0"
git-publish = "org.ajoberstar.git-publish:4.1.1"
pages = "com.hendraanggrian.pages:0.1"
ktlint = "org.jlleitschuh.gradle.ktlint:12.1.1"
gradle-publish = "com.gradle.plugin-publish:1.2.1"
git-publish = "org.ajoberstar.git-publish:4.2.2"
pages = "com.hanggrian.pages:0.2"

[libraries]
# lint
ktlint = "com.pinterest:ktlint:0.48.2"
rulebook-ktlint = "com.hendraanggrian.rulebook:rulebook-ktlint:0.2"
rulebook-ktlint = "com.hanggrian.rulebook:rulebook-ktlint:0.1"
# main
kotlinx-coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4"
osdetector = "com.google.gradle:osdetector-gradle-plugin:1.7.2"
# test
truth = "com.google.truth:truth:1.1.3"
truth = "com.google.truth:truth:1.4.4"
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
27 changes: 17 additions & 10 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -83,7 +85,9 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -130,26 +134,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -198,11 +205,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
Loading

0 comments on commit 93c4282

Please sign in to comment.