From beea41b406a4b2dfee6e6a5edb31c8b596205760 Mon Sep 17 00:00:00 2001 From: Ilya Matveev Date: Fri, 15 Sep 2017 14:40:16 +0300 Subject: [PATCH] gradle-plugin: Fix test running --- .../kotlin-native-gradle-plugin/build.gradle | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tools/kotlin-native-gradle-plugin/build.gradle b/tools/kotlin-native-gradle-plugin/build.gradle index 9a5399ed7e8..c4b5b8de1d2 100644 --- a/tools/kotlin-native-gradle-plugin/build.gradle +++ b/tools/kotlin-native-gradle-plugin/build.gradle @@ -1,3 +1,19 @@ +/* + * 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. + */ + /** * One may use bintrayUser/bintrayKey project properties or BINTRAY_USER/BINTRAY_KEY environment variables to upload * built plugin to bintray repository. @@ -46,6 +62,22 @@ repositories { mavenCentral() } +task pluginMetadata { + def outputDir = file("$buildDir/$name") + + inputs.files sourceSets.main.runtimeClasspath + outputs.dir outputDir + + doLast { + outputDir.mkdirs() + def metadata = new Properties() + metadata.put("implementation-classpath", sourceSets.main.runtimeClasspath.join(File.pathSeparator)) + file("$outputDir/plugin-under-test-metadata.properties").withPrintWriter { + metadata.store(it, "Plugin metadata") + } + } +} + dependencies { compile project(':shared') compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" @@ -56,6 +88,7 @@ dependencies { testCompile('org.spockframework:spock-core:1.1-groovy-2.4') { exclude module: 'groovy-all' } + testRuntime files(pluginMetadata) } test {