build: Use Gradle 4.2

This commit is contained in:
Ilya Matveev
2017-09-29 12:08:59 +03:00
committed by ilmat192
parent df3e114f31
commit fbb9163abf
10 changed files with 109 additions and 135 deletions
+4 -5
View File
@@ -211,11 +211,10 @@ task run {
} }
jar { jar {
from 'build/classes/cli_bc', from sourceSets.cli_bc.output,
'build/classes/compiler', sourceSets.compiler.output,
'build/classes/hashInteropStubs', sourceSets.hashInteropStubs.output,
'build/classes/llvmInteropStubs', sourceSets.llvmInteropStubs.output
'build/resources/compiler'
dependsOn ':runtime:hostRuntime', 'external_jars' dependsOn ':runtime:hostRuntime', 'external_jars'
} }
+1
View File
@@ -273,6 +273,7 @@ targetList.each { target ->
if (new PlatformInfo().isWindows()) if (new PlatformInfo().isWindows())
suffix = 'bat' suffix = 'bat'
task(taskName, type:GradleBuild) { task(taskName, type:GradleBuild) {
dependsOn ':dist'
dependsOn ':tools:kotlin-native-gradle-plugin:jar' dependsOn ':tools:kotlin-native-gradle-plugin:jar'
dependsOn defFile.config.depends.collect{defFileToTaskName(target, it)} dependsOn defFile.config.depends.collect{defFileToTaskName(target, it)}
tasks = ['clean', 'klibInstall'] tasks = ['clean', 'klibInstall']
@@ -19,7 +19,6 @@ package org.jetbrains.kotlin
import groovy.json.JsonOutput import groovy.json.JsonOutput
import org.gradle.api.DefaultTask import org.gradle.api.DefaultTask
import org.gradle.api.tasks.JavaExec import org.gradle.api.tasks.JavaExec
import org.gradle.api.tasks.ParallelizableTask
import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.TaskAction
import org.gradle.process.ExecResult import org.gradle.process.ExecResult
import org.jetbrains.kotlin.konan.target.* import org.jetbrains.kotlin.konan.target.*
@@ -79,13 +78,6 @@ abstract class KonanTest extends JavaExec {
dependsOn(project.rootProject.tasks['dist']) dependsOn(project.rootProject.tasks['dist'])
} }
@Override
void setJvmArgs(Iterable<?> arguments) {
super.setJvmArgs(arguments +
"-Dkonan.home=${dist.canonicalPath}" +
"-Djava.library.path=${dist.canonicalPath}/konan/nativelib")
}
@Override @Override
void exec() { void exec() {
// Perhaps later we will return this exec() back but for now rest of infrastructure expects // Perhaps later we will return this exec() back but for now rest of infrastructure expects
@@ -100,6 +92,8 @@ abstract class KonanTest extends JavaExec {
try { try {
main = 'org.jetbrains.kotlin.cli.bc.K2NativeKt' main = 'org.jetbrains.kotlin.cli.bc.K2NativeKt'
classpath = project.configurations.cli_bc classpath = project.configurations.cli_bc
jvmArgs "-Dkonan.home=${dist.canonicalPath}",
"-Djava.library.path=${dist.canonicalPath}/konan/nativelib"
enableAssertions = true enableAssertions = true
args = ["-output", output, args = ["-output", output,
*filesToCompile, *filesToCompile,
@@ -301,7 +295,6 @@ class TestFailedException extends RuntimeException {
super(s) super(s)
} }
} }
@ParallelizableTask
class RunKonanTest extends KonanTest { class RunKonanTest extends KonanTest {
void compileTest(List<String> filesToCompile, String exe) { void compileTest(List<String> filesToCompile, String exe) {
runCompiler(filesToCompile, exe, flags?:[]) runCompiler(filesToCompile, exe, flags?:[])
@@ -312,7 +305,6 @@ class RunKonanTest extends KonanTest {
// Don't use this task for regular testing as // Don't use this task for regular testing as
// project.exec + a shell script isolate the jvm // project.exec + a shell script isolate the jvm
// from IDEA. Use the RunKonanTest instead. // from IDEA. Use the RunKonanTest instead.
@ParallelizableTask
class RunDriverKonanTest extends KonanTest { class RunDriverKonanTest extends KonanTest {
RunDriverKonanTest() { RunDriverKonanTest() {
@@ -347,7 +339,6 @@ class RunDriverKonanTest extends KonanTest {
} }
} }
@ParallelizableTask
class RunInteropKonanTest extends KonanTest { class RunInteropKonanTest extends KonanTest {
private String interop private String interop
@@ -375,7 +366,6 @@ class RunInteropKonanTest extends KonanTest {
} }
} }
@ParallelizableTask
class LinkKonanTest extends KonanTest { class LinkKonanTest extends KonanTest {
protected String lib protected String lib
@@ -388,7 +378,6 @@ class LinkKonanTest extends KonanTest {
} }
} }
@ParallelizableTask
class RunExternalTestGroup extends RunKonanTest { class RunExternalTestGroup extends RunKonanTest {
def groupDirectory = "." def groupDirectory = "."
Binary file not shown.
+1 -18
View File
@@ -1,22 +1,5 @@
#
# Copyright 2010-2017 JetBrains s.r.o.
#
# 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.
#
#Thu Oct 27 13:47:42 MSK 2016
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-4.2-all.zip
Vendored
+13 -10
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env sh
############################################################################## ##############################################################################
## ##
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum" MAX_FD="maximum"
warn ( ) { warn () {
echo "$*" echo "$*"
} }
die ( ) { die () {
echo echo
echo "$*" echo "$*"
echo echo
@@ -154,16 +154,19 @@ if $cygwin ; then
esac esac
fi fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules # Escape application args
function splitJvmOpts() { save () {
JVM_OPTS=("$@") for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
} }
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS APP_ARGS=$(save "$@")
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
# 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 # 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 if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")" cd "$(dirname "$0")"
fi fi
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" exec "$JAVACMD" "$@"
Binary file not shown.
+1 -2
View File
@@ -1,6 +1,5 @@
#Fri Mar 31 14:34:32 NOVT 2017
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-4.2-bin.zip
+3 -3
View File
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum" MAX_FD="maximum"
warn ( ) { warn () {
echo "$*" echo "$*"
} }
die ( ) { die () {
echo echo
echo "$*" echo "$*"
echo echo
@@ -155,7 +155,7 @@ if $cygwin ; then
fi fi
# Escape application args # Escape application args
save ( ) { save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " " echo " "
} }
+84 -84
View File
@@ -1,84 +1,84 @@
@if "%DEBUG%" == "" @echo off @if "%DEBUG%" == "" @echo off
@rem ########################################################################## @rem ##########################################################################
@rem @rem
@rem Gradle startup script for Windows @rem Gradle startup script for Windows
@rem @rem
@rem ########################################################################## @rem ##########################################################################
@rem Set local scope for the variables with windows NT shell @rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0 set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=. if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS= set DEFAULT_JVM_OPTS=
@rem Find java.exe @rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init if "%ERRORLEVEL%" == "0" goto init
echo. echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo. echo.
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation. echo location of your Java installation.
goto fail goto fail
:findJavaFromJavaHome :findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=% set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init if exist "%JAVA_EXE%" goto init
echo. echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo. echo.
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation. echo location of your Java installation.
goto fail goto fail
:init :init
@rem Get command-line arguments, handling Windows variants @rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args :win9xME_args
@rem Slurp the command line arguments. @rem Slurp the command line arguments.
set CMD_LINE_ARGS= set CMD_LINE_ARGS=
set _SKIP=2 set _SKIP=2
:win9xME_args_slurp :win9xME_args_slurp
if "x%~1" == "x" goto execute if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%* set CMD_LINE_ARGS=%*
:execute :execute
@rem Setup the command line @rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle @rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd if "%ERRORLEVEL%"=="0" goto mainEnd
:fail :fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code! rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1 exit /b 1
:mainEnd :mainEnd
if "%OS%"=="Windows_NT" endlocal if "%OS%"=="Windows_NT" endlocal
:omega :omega