Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: JetBrains/kotlin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.8.21
Choose a base ref
...
head repository: JetBrains/kotlin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.8.22
Choose a head ref

Commits on Apr 27, 2023

  1. Move/copy legacy docs build to a separate directory

    (cherry picked from commit 9bceb6c)
    ilya-g committed Apr 27, 2023
    Copy the full SHA
    2088bc8 View commit details
  2. Setup project for docs build with new Dokka

    - Update Dokka to 1.6.20-M1
    - Update Dokka to 1.6.20
    - Update Dokka to 1.7.0-dev
    - Update Dokka to 1.7.20-dev-187
    
    Co-authored-by: ilya.gorbunov@jetbrains.com
    (cherry picked from commit e94818a)
    vmishenev authored and ilya-g committed Apr 27, 2023
    Copy the full SHA
    a15d307 View commit details
  3. Rectify docs task dependencies

    Introduce kotlin-test->stdlib doc task dependency due to package-list and fix package-list local path
    
    (cherry picked from commit e94ca37)
    ilya-g committed Apr 27, 2023
    Copy the full SHA
    9aaec50 View commit details
  4. Extract repeating parts of configuration

    (cherry picked from commit fbe1aff)
    ilya-g committed Apr 27, 2023
    Copy the full SHA
    b0f8109 View commit details
  5. Disable ignoreCommonBuiltIns in kotlin.test

    (cherry picked from commit a758e0b)
    vmishenev authored and ilya-g committed Apr 27, 2023
    Copy the full SHA
    a314a20 View commit details
  6. Documentation source sets configuration tuning

    - consistent naming of source sets
    - register JDK7/8 docs source sets only since 1.2
    - source set dependencies in kotlin-test module
    - classpath tuning
      - Enumerate classpath jars in library directories:
        compiler can't use just directory as a classpath
      - No need to pass classpaths for stdlib docs build:
        it's analyzed from sources and doesn't have other dependencies
    
    (cherry picked from commit e105d11)
    ilya-g committed Apr 27, 2023
    Copy the full SHA
    6089c61 View commit details
  7. Change docs artifacts directory layout for easier publishing

    Change module names of libraries to be consistent
    
    (cherry picked from commit 2cfbbb1)
    ilya-g committed Apr 27, 2023
    Copy the full SHA
    13e0890 View commit details
  8. Inline project with kotlin-native path settings

    (cherry picked from commit 95f2107)
    ilya-g committed Apr 27, 2023
    Copy the full SHA
    4013e41 View commit details
  9. Remove workaround for removing SinceKotlin from enums

    No longer needed with the modern Dokka
    
    (cherry picked from commit e813904)
    ilya-g committed Apr 27, 2023
    Copy the full SHA
    6d54a4f View commit details
  10. Update Dokka to 1.8.0-dev-195

    - Build dokka plugins with Kotlin 1.8 (required to compile with Dokka 1.8)
    
    (cherry picked from commit ef02b47)
    ilya-g committed Apr 27, 2023
    Copy the full SHA
    94248fb View commit details
  11. Migrate to Gradle KTS, step 1: rename

    (cherry picked from commit 63eaf3f)
    ilya-g committed Apr 27, 2023
    Copy the full SHA
    cd325bb View commit details
  12. Migrate to Gradle KTS, step 2: fix syntax

    (cherry picked from commit 65dbc1c)
    ilya-g committed Apr 27, 2023
    Copy the full SHA
    32beb5a View commit details
  13. Migrate to Gradle KTS, step 3: extract more common extension helpers

    (cherry picked from commit 6d3ddb9)
    ilya-g committed Apr 27, 2023
    Copy the full SHA
    48989a3 View commit details
  14. Allow to specify target and templates directory with Gradle properties

    (cherry picked from commit e3cfed8)
    ilya-g committed Apr 27, 2023
    Copy the full SHA
    e74b999 View commit details
  15. Determine snapshot version automatically from root gradle.properties

    (cherry picked from commit 6236a1f)
    ilya-g committed Apr 27, 2023
    Copy the full SHA
    d0c9e38 View commit details
  16. Setup multi-module docs build task

    (cherry picked from commit d695b0e)
    ilya-g committed Apr 27, 2023
    Copy the full SHA
    442f3f8 View commit details
  17. Render kotlin-reflect library documentation in a separate module

    (cherry picked from commit ba6732a)
    ilya-g committed Apr 27, 2023
    Copy the full SHA
    5e1e4ec View commit details
  18. docs: specialize build for latest version

    - leave only the latest version in versions list
    - remove conditions for previous versions
    - merge JVM7/8 source sets into JVM
    
    (cherry picked from commit 5a2d557)
    ilya-g committed Apr 27, 2023
    Copy the full SHA
    51d55cd View commit details
  19. Fix missing native-wasm source set in legacy docs build

    (cherry picked from commit 69b90e1)
    ilya-g committed Apr 27, 2023
    Copy the full SHA
    2da94ed View commit details
  20. Copy the full SHA
    596ff23 View commit details
  21. docs build: move parameter initialization to the parent project

    in order to avoid evaluationDependsOn dependency
    ilya-g committed Apr 27, 2023
    Copy the full SHA
    d57f335 View commit details
  22. docs build: allow to specify custom dokka repository

    - centralize repository management in settings.gradle.kts
    - allow to specify dokka repository with a gradle property
    - automatically add mavenLocal for -local dokka versions
    - specify kotlin version for building plugins in one place
    ilya-g committed Apr 27, 2023
    Copy the full SHA
    0389c35 View commit details
  23. Update Dokka to 1.8.20-dev-213

    (cherry picked from commit 36cb94c)
    ilya-g committed Apr 27, 2023
    Copy the full SHA
    0043ae4 View commit details

Commits on Jun 5, 2023

  1. [Gradle] Implement KT58280JvmWithJavaTestCompileClasspath to cover KT…

    …-58280
    
    (cherry picked from commit 3196981)
    sellmair authored and qodana-bot committed Jun 5, 2023

    Unverified

    The committer email address is not verified.
    Copy the full SHA
    90a9bf9 View commit details
  2. [Gradle] KotlinCompilationAssociator: Restore 1.8.10 behaviour for Ko…

    …tlinWithJavaTarget
    
    ^KT-58280 Verification Pending
    
    (cherry picked from commit 08f3d56)
    sellmair authored and qodana-bot committed Jun 5, 2023

    Unverified

    The committer email address is not verified.
    Copy the full SHA
    918a74f View commit details

Commits on Jun 7, 2023

  1. Add changelog for 1.8.22

    woainikk committed Jun 7, 2023
    Copy the full SHA
    fe01561 View commit details
Showing with 1,601 additions and 144 deletions.
  1. +1 −0 .space/CODEOWNERS
  2. +7 −0 ChangeLog.md
  3. +1 −1 libraries/kotlin.test/Module.md
  4. +18 −0 libraries/reflect/Module.md
  5. +1 −1 libraries/stdlib/src/Module.md
  6. +9 −4 ...adle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/SimpleKotlinGradleIT.kt
  7. +7 −1 ...mmon/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/compilationImpl/KotlinCompilationAssociator.kt
  8. +50 −0 ...Test/kotlin/org/jetbrains/kotlin/gradle/regressionTests/KT58280JvmWithJavaTestCompileClasspath.kt
  9. +7 −0 libraries/tools/kotlin-stdlib-docs-legacy/README.md
  10. 0 libraries/tools/{kotlin-stdlib-docs → kotlin-stdlib-docs-legacy}/ant/build.gradle
  11. +1 −0 libraries/tools/{kotlin-stdlib-docs → kotlin-stdlib-docs-legacy}/build-docs.xml
  12. 0 libraries/tools/{kotlin-stdlib-docs → kotlin-stdlib-docs-legacy}/build.gradle
  13. BIN libraries/tools/kotlin-stdlib-docs-legacy/gradle/wrapper/gradle-wrapper.jar
  14. +5 −0 libraries/tools/kotlin-stdlib-docs-legacy/gradle/wrapper/gradle-wrapper.properties
  15. +188 −0 libraries/tools/kotlin-stdlib-docs-legacy/gradlew
  16. +100 −0 libraries/tools/kotlin-stdlib-docs-legacy/gradlew.bat
  17. +9 −1 libraries/tools/{kotlin-stdlib-docs → kotlin-stdlib-docs-legacy}/kotlin_big/build.gradle
  18. 0 libraries/tools/{kotlin-stdlib-docs → kotlin-stdlib-docs-legacy}/kotlin_native/build.gradle
  19. 0 libraries/tools/{kotlin-stdlib-docs → kotlin-stdlib-docs-legacy}/settings.gradle
  20. +1 −1 libraries/tools/kotlin-stdlib-docs/README.md
  21. +415 −0 libraries/tools/kotlin-stdlib-docs/build.gradle.kts
  22. +3 −0 libraries/tools/kotlin-stdlib-docs/gradle.properties
  23. BIN libraries/tools/kotlin-stdlib-docs/gradle/wrapper/gradle-wrapper.jar
  24. +3 −1 libraries/tools/kotlin-stdlib-docs/gradle/wrapper/gradle-wrapper.properties
  25. +166 −110 libraries/tools/kotlin-stdlib-docs/gradlew
  26. +16 −24 libraries/tools/kotlin-stdlib-docs/gradlew.bat
  27. +54 −0 libraries/tools/kotlin-stdlib-docs/kotlin_big/build.gradle.kts
  28. +3 −0 libraries/tools/kotlin-stdlib-docs/plugins/build.gradle.kts
  29. +17 −0 libraries/tools/kotlin-stdlib-docs/plugins/dokka-samples-transformer-plugin/build.gradle
  30. +196 −0 ...nsformer-plugin/src/main/kotlin/org/jetbrains/dokka/kotlinlang/KotlinWebsiteSamplesTransformer.kt
  31. +21 −0 ...les-transformer-plugin/src/main/kotlin/org/jetbrains/dokka/kotlinlang/SamplesTransformerPlugin.kt
  32. +1 −0 ...ansformer-plugin/src/main/resources/META-INF/services/org.jetbrains.dokka.plugability.DokkaPlugin
  33. +17 −0 libraries/tools/kotlin-stdlib-docs/plugins/dokka-stdlib-configuration-plugin/build.gradle
  34. +5 −0 ...onfiguration-plugin/src/main/kotlin/org/jetbrains/dokka/kotlinlang/StdLibAnalysisConfiguration.kt
  35. +33 −0 ...-configuration-plugin/src/main/kotlin/org/jetbrains/dokka/kotlinlang/StdLibConfigurationPlugin.kt
  36. +1 −0 ...iguration-plugin/src/main/resources/META-INF/services/org.jetbrains.dokka.plugability.DokkaPlugin
  37. +19 −0 libraries/tools/kotlin-stdlib-docs/plugins/dokka-version-filter-plugin/build.gradle
  38. +5 −0 ...ersion-filter-plugin/src/main/kotlin/org/jetbrains/dokka/kotlinlang/VersionFilterConfiguration.kt
  39. +25 −0 ...dokka-version-filter-plugin/src/main/kotlin/org/jetbrains/dokka/kotlinlang/VersionFilterPlugin.kt
  40. +123 −0 ...-version-filter-plugin/src/main/kotlin/org/jetbrains/dokka/kotlinlang/VersionFilterTransformer.kt
  41. +1 −0 ...on-filter-plugin/src/main/resources/META-INF/services/org.jetbrains.dokka.plugability.DokkaPlugin
  42. +35 −0 libraries/tools/kotlin-stdlib-docs/settings.gradle.kts
  43. +7 −0 libraries/tools/kotlin-stdlib-docs/templates/includes/footer.ftl
  44. +24 −0 libraries/tools/kotlin-stdlib-docs/templates/includes/header.ftl
  45. +6 −0 libraries/tools/kotlin-stdlib-docs/templates/includes/page_metadata.ftl
1 change: 1 addition & 0 deletions .space/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -321,6 +321,7 @@
/libraries/tools/kotlin-serialization/ "Kotlin Build Tools"
/libraries/tools/kotlin-serialization-unshaded/ "Kotlin Build Tools"
/libraries/tools/kotlin-stdlib-docs/ A.Qurbonzoda Vsevolod.Tolstopyato Ilya.Gorbunov
/libraries/tools/kotlin-stdlib-docs-legacy/ A.Qurbonzoda Vsevolod.Tolstopyato Ilya.Gorbunov
/libraries/tools/kotlin-stdlib-gen/ A.Qurbonzoda Vsevolod.Tolstopyato Ilya.Gorbunov
/libraries/tools/kotlin-test-js-runner/ "Kotlin JS"
/libraries/tools/kotlin-tooling-core/ "Kotlin Build Tools" "Kotlin Multiplatform"
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 1.8.22

### Tools. Gradle

- [`KT-58280`](https://youtrack.jetbrains.com/issue/KT-58280) org.jetbrains.kotlin.jvm Gradle plugin contributes build directories to the test compile classpath


## 1.8.21

### Compiler
2 changes: 1 addition & 1 deletion libraries/kotlin.test/Module.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Module kotlin.test
# Module kotlin-test

## kotlin.test

18 changes: 18 additions & 0 deletions libraries/reflect/Module.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Module kotlin-reflect

## Kotlin JVM reflection extensions

The library provides the runtime component that enables full support of the reflection features in `kotlin.reflect` package
and extensions for the reflection types.

It's provided as an optional artifact separate from the standard library to reduce the required size of the runtime dependencies
for applications that do not use reflection features.

# Package kotlin.reflect.full

Extensions for [Kotlin reflection](https://kotlinlang.org/docs/reference/reflection.html) types like [kotlin.reflect.KClass], [kotlin.reflect.KType], and others.

# Package kotlin.reflect.jvm

Extensions for conversion between [Kotlin reflection](https://kotlinlang.org/docs/reference/reflection.html) and
Java reflection types and other JVM-specific extensions.
2 changes: 1 addition & 1 deletion libraries/stdlib/src/Module.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Module stdlib
# Module kotlin-stdlib

## Kotlin Standard Library

Original file line number Diff line number Diff line change
@@ -284,11 +284,16 @@ class SimpleKotlinGradleIT : KGPBaseTest() {
buildGradle.appendText(
"""
|
|tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile.class).configureEach {
| if (it.name == "compileKotlin") {
| it.destinationDirectory.set(project.layout.buildDirectory.dir("banana"))
| }
|def compileKotlinTask = tasks.named("compileKotlin", org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile.class)
|
|compileKotlinTask.configure {
| it.destinationDirectory.set(project.layout.buildDirectory.dir("banana"))
|}
|
|def compileKotlinTaskOutput = compileKotlinTask.flatMap { it.destinationDirectory }
|sourceSets.test.compileClasspath.from(compileKotlinTaskOutput)
|sourceSets.test.runtimeClasspath.from(compileKotlinTaskOutput)
|
""".trimMargin()
)

Original file line number Diff line number Diff line change
@@ -7,8 +7,10 @@ package org.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl

import org.gradle.api.Project
import org.gradle.api.artifacts.Dependency
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType.jvm
import org.jetbrains.kotlin.gradle.plugin.KotlinTarget
import org.jetbrains.kotlin.gradle.plugin.mpp.InternalKotlinCompilation
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinWithJavaTarget
import org.jetbrains.kotlin.gradle.plugin.mpp.isMain
import org.jetbrains.kotlin.gradle.plugin.mpp.isTest
import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget
@@ -76,7 +78,11 @@ internal object KotlinNativeCompilationAssociator : KotlinCompilationAssociator
internal object KotlinJvmCompilationAssociator : KotlinCompilationAssociator {
override fun associate(target: KotlinTarget, auxiliary: InternalKotlinCompilation<*>, main: InternalKotlinCompilation<*>) {
/* Main to Test association handled already by java plugin */
if (target is KotlinJvmTarget && target.withJavaEnabled && auxiliary.isTest() && main.isMain()) {
if (
((target is KotlinWithJavaTarget<*, *> && target.platformType == jvm) ||
(target is KotlinJvmTarget && target.withJavaEnabled)) &&
auxiliary.isTest() && main.isMain()
) {
return
} else DefaultKotlinCompilationAssociator.associate(target, auxiliary, main)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/

@file:Suppress("FunctionName")

package org.jetbrains.kotlin.gradle.regressionTests

import org.jetbrains.kotlin.gradle.dependencyResolutionTests.kpm.mavenCentralCacheRedirector
import org.jetbrains.kotlin.gradle.dsl.kotlinJvmExtension
import org.jetbrains.kotlin.gradle.plugin.mpp.internal
import org.jetbrains.kotlin.gradle.util.applyKotlinJvmPlugin
import org.jetbrains.kotlin.gradle.util.buildProject
import org.jetbrains.kotlin.gradle.util.main
import org.jetbrains.kotlin.gradle.util.test
import kotlin.test.Test
import kotlin.test.fail

class KT58280JvmWithJavaTestCompileClasspath {
/**
* Context:
* https://youtrack.jetbrains.com/issue/KT-58280/org.jetbrains.kotlin.jvm-Gradle-plugin-contributes-build-directories-to-the-test-compile-classpath
*
* This is not necessarily a 'regression' as IntelliJ and CLI compilations work fine.
* Tools like eclipse did not expect this output.
*
* The commit the initially (and accidentally) changed the behavior was:
* [Gradle] Implement KotlinWithJavaCompilation with underlying KotlinCompilationImpl Sebastian Sellmair* 04.10.22, 17:16
* af198825899df9943814e2cb54d39868fff399fb
*
* This test 'fixates' the old behaviour.
*/
@Test
fun `test - KT58280 - jvmWithJava Target does not add main classes to test compile classpath`() {
val project = buildProject()
project.plugins.apply("java-library")
project.applyKotlinJvmPlugin()
project.repositories.mavenLocal()
project.repositories.mavenCentralCacheRedirector()
val kotlin = project.kotlinJvmExtension

/* This kind of association is not required for java: java plugin handles this separately */
kotlin.target.compilations.test.internal.configurations.compileDependencyConfiguration.resolvedConfiguration.files.forEach { file ->
if (file in kotlin.target.compilations.main.output.allOutputs) {
fail("Unexpected file in test compile dependencies: $file")
}
}
}
}
7 changes: 7 additions & 0 deletions libraries/tools/kotlin-stdlib-docs-legacy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kotlin-stdlib-docs-legacy
===================

Legacy scripts to build API documentation for kotlin stdlib, kotlin test (and others?) libraries for
kotlinlang.org web-site.


Original file line number Diff line number Diff line change
@@ -260,6 +260,7 @@
<sourceroot path="${kotlin_native_root}/Interop/Runtime/src/native/kotlin"/>
<sourceroot path="${kotlin_native_root}/Interop/JsRuntime/src/main/kotlin"/>
<sourceroot path="${kotlin_native_root}/runtime/src/main/kotlin"/>
<sourceroot path="${kotlin_stdlib_dir}/native-wasm/src"/>

<packageoptions prefix="kotlin.native.internal" suppress="true"/>
<packageoptions prefix="kotlin.test" suppress="true"/>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
188 changes: 188 additions & 0 deletions libraries/tools/kotlin-stdlib-docs-legacy/gradlew
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# 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"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn () {
echo "$*"
}

die () {
echo
echo "$*"
echo
exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
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.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option

if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
Loading