diff options
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/devcontainer-feature.json | 19 | ||||
-rw-r--r-- | src/java/install.sh | 7 |
2 files changed, 24 insertions, 2 deletions
diff --git a/src/java/devcontainer-feature.json b/src/java/devcontainer-feature.json index 113c75d..f55276a 100644 --- a/src/java/devcontainer-feature.json +++ b/src/java/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "java", - "version": "1.1.1", + "version": "1.2.0", "name": "Java (via SDKMAN!)", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/java", "description": "Installs Java, SDKMAN! (if not installed), and needed dependencies.", @@ -59,6 +59,21 @@ ], "default": "latest", "description": "Select or enter a Maven version" + }, + "installAnt": { + "type": "boolean", + "default": false, + "description": "Install Ant, a software tool for automating software build processes" + }, + "antVersion": { + "type": "string", + "proposals": [ + "latest", + "1.10.12", + "1.9.15" + ], + "default": "latest", + "description": "Select or enter an Ant version" } }, "customizations": { @@ -74,7 +89,7 @@ "containerEnv": { "SDKMAN_DIR": "/usr/local/sdkman", "JAVA_HOME": "/usr/local/sdkman/candidates/java/current", - "PATH": "/usr/local/sdkman/bin:/usr/local/sdkman/candidates/java/current/bin:/usr/local/sdkman/candidates/gradle/current/bin:/usr/local/sdkman/candidates/maven/current/bin:${PATH}" + "PATH": "/usr/local/sdkman/bin:/usr/local/sdkman/candidates/java/current/bin:/usr/local/sdkman/candidates/gradle/current/bin:/usr/local/sdkman/candidates/maven/current/bin:/usr/local/sdkman/candidates/ant/current/bin:${PATH}" }, "installsAfter": [ "ghcr.io/devcontainers/features/common-utils" diff --git a/src/java/install.sh b/src/java/install.sh index bf94963..ea43dd3 100644 --- a/src/java/install.sh +++ b/src/java/install.sh @@ -14,6 +14,8 @@ INSTALL_GRADLE="${INSTALLGRADLE:-"false"}" GRADLE_VERSION="${GRADLEVERSION:-"latest"}" INSTALL_MAVEN="${INSTALLMAVEN:-"false"}" MAVEN_VERSION="${MAVENVERSION:-"latest"}" +INSTALL_ANT="${INSTALLANT:-"false"}" +ANT_VERSION="${ANTVERSION:-"latest"}" JDK_DISTRO="${JDKDISTRO}" export SDKMAN_DIR="${SDKMAN_DIR:-"/usr/local/sdkman"}" @@ -173,6 +175,11 @@ if [ ! -z "${ADDITIONAL_VERSIONS}" ]; then su ${USERNAME} -c ". ${SDKMAN_DIR}/bin/sdkman-init.sh && sdk default java ${JAVA_VERSION}" fi +# Install Ant +if [[ "${INSTALL_ANT}" = "true" ]] && ! ant -version > /dev/null; then + sdk_install ant ${ANT_VERSION} +fi + # Install Gradle if [[ "${INSTALL_GRADLE}" = "true" ]] && ! gradle --version > /dev/null; then sdk_install gradle ${GRADLE_VERSION} |