Update build version of Kotlin to 1.3-M2
Fix tests: replace source sets with properties Fix interop: move cValuesOfUnsigned to native part
This commit is contained in:
committed by
Pavel Punegov
parent
97a423c781
commit
9972a57af6
@@ -321,22 +321,6 @@ fun cValuesOf(vararg elements: Int): CValues<IntVar> =
|
||||
fun cValuesOf(vararg elements: Long): CValues<LongVar> =
|
||||
createValues(elements.size) { index -> this.value = elements[index] }
|
||||
|
||||
@JvmName("cValuesOfUnsigned")
|
||||
fun cValuesOf(vararg elements: UByte): CValues<UByteVar> =
|
||||
createValues(elements.size) { index -> this.value = elements[index] }
|
||||
|
||||
@JvmName("cValuesOfUnsigned")
|
||||
fun cValuesOf(vararg elements: UShort): CValues<UShortVar> =
|
||||
createValues(elements.size) { index -> this.value = elements[index] }
|
||||
|
||||
@JvmName("cValuesOfUnsigned")
|
||||
fun cValuesOf(vararg elements: UInt): CValues<UIntVar> =
|
||||
createValues(elements.size) { index -> this.value = elements[index] }
|
||||
|
||||
@JvmName("cValuesOfUnsigned")
|
||||
fun cValuesOf(vararg elements: ULong): CValues<ULongVar> =
|
||||
createValues(elements.size) { index -> this.value = elements[index] }
|
||||
|
||||
fun cValuesOf(vararg elements: Float): CValues<FloatVar> = object : CValues<FloatVar>() {
|
||||
override fun getPointer(scope: AutofreeScope) = scope.allocArrayOf(*elements)
|
||||
override val size get() = 4 * elements.size
|
||||
|
||||
@@ -47,4 +47,16 @@ external fun <R : Number> Number.narrow(): R
|
||||
|
||||
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.FILE)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
internal annotation class JvmName(val name: String)
|
||||
internal annotation class JvmName(val name: String)
|
||||
|
||||
fun cValuesOf(vararg elements: UByte): CValues<UByteVar> =
|
||||
createValues(elements.size) { index -> this.value = elements[index] }
|
||||
|
||||
fun cValuesOf(vararg elements: UShort): CValues<UShortVar> =
|
||||
createValues(elements.size) { index -> this.value = elements[index] }
|
||||
|
||||
fun cValuesOf(vararg elements: UInt): CValues<UIntVar> =
|
||||
createValues(elements.size) { index -> this.value = elements[index] }
|
||||
|
||||
fun cValuesOf(vararg elements: ULong): CValues<ULongVar> =
|
||||
createValues(elements.size) { index -> this.value = elements[index] }
|
||||
@@ -65,27 +65,17 @@ project.convention.plugins.executor = ExecutorServiceKt.create(project)
|
||||
|
||||
allprojects {
|
||||
// Root directories for test output (logs, compiled files, statistics etc). Only single path must be in each set.
|
||||
sourceSets {
|
||||
// backend.native/tests
|
||||
testOutputLocal {
|
||||
output.dir(rootProject.file("$testOutputRoot/local"))
|
||||
}
|
||||
// backend.native/tests
|
||||
ext.testOutputLocal = rootProject.file("$testOutputRoot/local")
|
||||
|
||||
// backend.native/tests/external
|
||||
testOutputExternal {
|
||||
output.dir(rootProject.file("$testOutputRoot/external"))
|
||||
}
|
||||
// backend.native/tests/external
|
||||
ext.testOutputExternal = rootProject.file("$testOutputRoot/external")
|
||||
|
||||
// backend.native/tests/stdlib_external
|
||||
testOutputStdlib {
|
||||
output.dir(rootProject.file("$testOutputRoot/stdlib"))
|
||||
}
|
||||
// backend.native/tests/stdlib_external
|
||||
ext.testOutputStdlib = rootProject.file("$testOutputRoot/stdlib")
|
||||
|
||||
// backend.native/tests/framework
|
||||
testOutputFramework {
|
||||
output.dir(rootProject.file("$testOutputRoot/framework"))
|
||||
}
|
||||
}
|
||||
// backend.native/tests/framework
|
||||
ext.testOutputFramework = rootProject.file("$testOutputRoot/framework")
|
||||
}
|
||||
|
||||
konanArtifacts {
|
||||
@@ -165,7 +155,7 @@ task resultsTask() {
|
||||
|
||||
def output = ["statistics": statistics, "tests": results]
|
||||
def json = JsonOutput.toJson(output)
|
||||
def reportFile = new File(sourceSets.testOutputExternal.output.getDirs().getSingleFile(), "results.json")
|
||||
def reportFile = new File(testOutputExternal, "results.json")
|
||||
reportFile.write(JsonOutput.prettyPrint(json))
|
||||
println("DONE.\n\n" +
|
||||
"TOTAL: $statistics.total\n" +
|
||||
@@ -2889,13 +2879,6 @@ task produce_dynamic(type: DynamicKonanTest) {
|
||||
"topLevel = 777 3\n"
|
||||
}
|
||||
|
||||
/**
|
||||
* Get sourceSet's output path as a string
|
||||
*/
|
||||
static String outputPath(SourceSet set) {
|
||||
return set.output.getDirs().getSingleFile().toString()
|
||||
}
|
||||
|
||||
if (isMac() && project.testTarget != 'wasm32') {
|
||||
def target = ext.platformManager.targetByName(project.testTarget ?: 'host').name
|
||||
|
||||
@@ -2904,7 +2887,7 @@ if (isMac() && project.testTarget != 'wasm32') {
|
||||
konanArtifacts {
|
||||
framework(frameworkName, targets: [ target ]) {
|
||||
srcDir 'framework/values'
|
||||
baseDir outputPath(sourceSets.testOutputFramework) + "/$frameworkName"
|
||||
baseDir "$testOutputFramework/$frameworkName"
|
||||
|
||||
if (!useCustomDist) {
|
||||
dependsOn ":${target}CrossDistRuntime", ':commonDistRuntime', ':distCompiler'
|
||||
@@ -2919,7 +2902,7 @@ if (isMac() && project.testTarget != 'wasm32') {
|
||||
konanArtifacts {
|
||||
framework(frameworkName, targets: [ target ]) {
|
||||
srcDir 'framework/stdlib'
|
||||
baseDir outputPath(sourceSets.testOutputFramework) + "/$frameworkName"
|
||||
baseDir "$testOutputFramework/$frameworkName"
|
||||
|
||||
if (!useCustomDist) {
|
||||
dependsOn ":${target}CrossDistRuntime", ':commonDistRuntime', ':distCompiler'
|
||||
|
||||
@@ -62,10 +62,9 @@ abstract class KonanTest extends JavaExec {
|
||||
if (outputDirectory != null) {
|
||||
return
|
||||
}
|
||||
|
||||
def outputSourceSet = project.sourceSets.findByName(getOutputSourceSetName())
|
||||
def outputSourceSet = project.findProperty(getOutputSourceSetName())
|
||||
if (outputSourceSet != null) {
|
||||
outputDirectory = outputSourceSet.output.getDirs().getSingleFile().absolutePath + "/$name"
|
||||
outputDirectory = outputSourceSet.absolutePath + "/$name"
|
||||
project.file(outputDirectory).mkdirs()
|
||||
} else {
|
||||
outputDirectory = getTemporaryDir().absolutePath
|
||||
@@ -338,9 +337,9 @@ abstract class ExtKonanTest extends KonanTest {
|
||||
return
|
||||
}
|
||||
|
||||
def outputSourceSet = project.sourceSets.findByName(getOutputSourceSetName())
|
||||
def outputSourceSet = project.findProperty(getOutputSourceSetName())
|
||||
if (outputSourceSet != null) {
|
||||
outputDirectory = outputSourceSet.output.getDirs().getSingleFile().absolutePath
|
||||
outputDirectory = outputSourceSet.absolutePath
|
||||
project.file(outputDirectory).mkdirs()
|
||||
} else {
|
||||
outputDirectory = getTemporaryDir().absolutePath
|
||||
@@ -882,9 +881,9 @@ fun runTest() {
|
||||
@Override
|
||||
String buildExePath() {
|
||||
def outputDir
|
||||
def outputSourceSet = project.sourceSets.findByName(getOutputSourceSetName())
|
||||
def outputSourceSet = project.findProperty(getOutputSourceSetName())
|
||||
if (outputSourceSet != null) {
|
||||
outputDir = outputSourceSet.output.getDirs().getSingleFile().absolutePath + "/$name"
|
||||
outputDir = outputSourceSet.absolutePath+ "/$name"
|
||||
} else {
|
||||
outputDir = getTemporaryDir().absolutePath
|
||||
}
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
#
|
||||
|
||||
# A version of the Kotlin "toolchain" (compiler, runtime, stdlib etc) used by the build script.
|
||||
buildKotlinVersion=1.3-M1
|
||||
buildKotlinVersion=1.3-M2
|
||||
buildKotlinCompilerRepo=http://dl.bintray.com/kotlin/kotlin-eap
|
||||
remoteRoot=konan_tests
|
||||
testDataVersion=1226829:id
|
||||
|
||||
+8
@@ -23,6 +23,14 @@ open class KotlinNativePlatformPlugin: KotlinPlatformImplementationPluginBase("n
|
||||
}
|
||||
}
|
||||
|
||||
internal fun <T> Project.whenEvaluated(fn: Project.() -> T) {
|
||||
if (state.executed) {
|
||||
fn()
|
||||
} else {
|
||||
afterEvaluate { it.fn() }
|
||||
}
|
||||
}
|
||||
|
||||
protected fun addCommonProject(commonProject: Project, platformProject: Project) {
|
||||
commonProjects.add(commonProject)
|
||||
commonProject.whenEvaluated {
|
||||
|
||||
Reference in New Issue
Block a user