Wizard: specify test platform to use on JVM
#KT-37965 fixed
This commit is contained in:
+3
@@ -15,6 +15,9 @@ kotlin {
|
|||||||
compilations.all {
|
compilations.all {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
|
testRuns["test"].executionTask.configure {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sourceSets {
|
sourceSets {
|
||||||
jvmMain {
|
jvmMain {
|
||||||
|
|||||||
+3
@@ -15,6 +15,9 @@ kotlin {
|
|||||||
compilations.all {
|
compilations.all {
|
||||||
kotlinOptions.jvmTarget = "1.8"
|
kotlinOptions.jvmTarget = "1.8"
|
||||||
}
|
}
|
||||||
|
testRuns["test"].executionTask.configure {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sourceSets {
|
sourceSets {
|
||||||
val jvmMain by getting
|
val jvmMain by getting
|
||||||
|
|||||||
+3
@@ -16,6 +16,9 @@ kotlin {
|
|||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
withJava()
|
withJava()
|
||||||
|
testRuns["test"].executionTask.configure {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sourceSets {
|
sourceSets {
|
||||||
jvmMain {
|
jvmMain {
|
||||||
|
|||||||
+3
@@ -16,6 +16,9 @@ kotlin {
|
|||||||
kotlinOptions.jvmTarget = "1.8"
|
kotlinOptions.jvmTarget = "1.8"
|
||||||
}
|
}
|
||||||
withJava()
|
withJava()
|
||||||
|
testRuns["test"].executionTask.configure {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sourceSets {
|
sourceSets {
|
||||||
val jvmMain by getting
|
val jvmMain by getting
|
||||||
|
|||||||
+3
@@ -15,6 +15,9 @@ dependencies {
|
|||||||
implementation project(':c')
|
implementation project(':c')
|
||||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||||
}
|
}
|
||||||
|
test {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
+3
@@ -17,6 +17,9 @@ dependencies {
|
|||||||
implementation(project(":c"))
|
implementation(project(":c"))
|
||||||
testImplementation(kotlin("test-junit"))
|
testImplementation(kotlin("test-junit"))
|
||||||
}
|
}
|
||||||
|
tasks.test {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
tasks.withType<KotlinCompile>() {
|
tasks.withType<KotlinCompile>() {
|
||||||
kotlinOptions.jvmTarget = "1.8"
|
kotlinOptions.jvmTarget = "1.8"
|
||||||
}
|
}
|
||||||
+8
@@ -60,6 +60,14 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-failsafe-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
+3
@@ -15,6 +15,9 @@ dependencies {
|
|||||||
implementation project(':d')
|
implementation project(':d')
|
||||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||||
}
|
}
|
||||||
|
test {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
+3
@@ -17,6 +17,9 @@ dependencies {
|
|||||||
implementation(project(":d"))
|
implementation(project(":d"))
|
||||||
testImplementation(kotlin("test-junit"))
|
testImplementation(kotlin("test-junit"))
|
||||||
}
|
}
|
||||||
|
tasks.test {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
tasks.withType<KotlinCompile>() {
|
tasks.withType<KotlinCompile>() {
|
||||||
kotlinOptions.jvmTarget = "1.8"
|
kotlinOptions.jvmTarget = "1.8"
|
||||||
}
|
}
|
||||||
+8
@@ -60,6 +60,14 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-failsafe-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
+3
@@ -13,6 +13,9 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||||
}
|
}
|
||||||
|
test {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
+3
@@ -15,6 +15,9 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
testImplementation(kotlin("test-junit"))
|
testImplementation(kotlin("test-junit"))
|
||||||
}
|
}
|
||||||
|
tasks.test {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
tasks.withType<KotlinCompile>() {
|
tasks.withType<KotlinCompile>() {
|
||||||
kotlinOptions.jvmTarget = "1.8"
|
kotlinOptions.jvmTarget = "1.8"
|
||||||
}
|
}
|
||||||
+8
@@ -60,6 +60,14 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-failsafe-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
+3
@@ -14,6 +14,9 @@ dependencies {
|
|||||||
implementation project(':a')
|
implementation project(':a')
|
||||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||||
}
|
}
|
||||||
|
test {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
+3
@@ -16,6 +16,9 @@ dependencies {
|
|||||||
implementation(project(":a"))
|
implementation(project(":a"))
|
||||||
testImplementation(kotlin("test-junit"))
|
testImplementation(kotlin("test-junit"))
|
||||||
}
|
}
|
||||||
|
tasks.test {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
tasks.withType<KotlinCompile>() {
|
tasks.withType<KotlinCompile>() {
|
||||||
kotlinOptions.jvmTarget = "1.8"
|
kotlinOptions.jvmTarget = "1.8"
|
||||||
}
|
}
|
||||||
+8
@@ -60,6 +60,14 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-failsafe-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
+3
@@ -14,6 +14,9 @@ dependencies {
|
|||||||
rootProject
|
rootProject
|
||||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||||
}
|
}
|
||||||
|
test {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
+3
@@ -16,6 +16,9 @@ dependencies {
|
|||||||
rootProject
|
rootProject
|
||||||
testImplementation(kotlin("test-junit"))
|
testImplementation(kotlin("test-junit"))
|
||||||
}
|
}
|
||||||
|
tasks.test {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
tasks.withType<KotlinCompile>() {
|
tasks.withType<KotlinCompile>() {
|
||||||
kotlinOptions.jvmTarget = "1.8"
|
kotlinOptions.jvmTarget = "1.8"
|
||||||
}
|
}
|
||||||
+3
@@ -14,6 +14,9 @@ dependencies {
|
|||||||
implementation project(':b')
|
implementation project(':b')
|
||||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||||
}
|
}
|
||||||
|
test {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
+3
@@ -16,6 +16,9 @@ dependencies {
|
|||||||
implementation(project(":b"))
|
implementation(project(":b"))
|
||||||
testImplementation(kotlin("test-junit"))
|
testImplementation(kotlin("test-junit"))
|
||||||
}
|
}
|
||||||
|
tasks.test {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
tasks.withType<KotlinCompile>() {
|
tasks.withType<KotlinCompile>() {
|
||||||
kotlinOptions.jvmTarget = "1.8"
|
kotlinOptions.jvmTarget = "1.8"
|
||||||
}
|
}
|
||||||
+8
@@ -60,6 +60,14 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-failsafe-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
+8
@@ -60,6 +60,14 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-failsafe-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
+3
@@ -13,6 +13,9 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||||
}
|
}
|
||||||
|
test {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
+3
@@ -15,6 +15,9 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
testImplementation(kotlin("test-junit"))
|
testImplementation(kotlin("test-junit"))
|
||||||
}
|
}
|
||||||
|
tasks.test {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
tasks.withType<KotlinCompile>() {
|
tasks.withType<KotlinCompile>() {
|
||||||
kotlinOptions.jvmTarget = "1.8"
|
kotlinOptions.jvmTarget = "1.8"
|
||||||
}
|
}
|
||||||
+8
@@ -60,6 +60,14 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-failsafe-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
+3
@@ -13,6 +13,9 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||||
}
|
}
|
||||||
|
test {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = '1.6'
|
kotlinOptions.jvmTarget = '1.6'
|
||||||
}
|
}
|
||||||
+3
@@ -15,6 +15,9 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
testImplementation(kotlin("test-junit"))
|
testImplementation(kotlin("test-junit"))
|
||||||
}
|
}
|
||||||
|
tasks.test {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
tasks.withType<KotlinCompile>() {
|
tasks.withType<KotlinCompile>() {
|
||||||
kotlinOptions.jvmTarget = "1.6"
|
kotlinOptions.jvmTarget = "1.6"
|
||||||
}
|
}
|
||||||
+3
@@ -15,6 +15,9 @@ kotlin {
|
|||||||
compilations.all {
|
compilations.all {
|
||||||
kotlinOptions.jvmTarget = '9'
|
kotlinOptions.jvmTarget = '9'
|
||||||
}
|
}
|
||||||
|
testRuns["test"].executionTask.configure {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
js('a', LEGACY) {
|
js('a', LEGACY) {
|
||||||
browser {
|
browser {
|
||||||
|
|||||||
+3
@@ -15,6 +15,9 @@ kotlin {
|
|||||||
compilations.all {
|
compilations.all {
|
||||||
kotlinOptions.jvmTarget = "9"
|
kotlinOptions.jvmTarget = "9"
|
||||||
}
|
}
|
||||||
|
testRuns["test"].executionTask.configure {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
js("a", LEGACY) {
|
js("a", LEGACY) {
|
||||||
browser {
|
browser {
|
||||||
|
|||||||
+3
@@ -13,6 +13,9 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||||
}
|
}
|
||||||
|
test {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
+3
@@ -15,6 +15,9 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
testImplementation(kotlin("test-junit"))
|
testImplementation(kotlin("test-junit"))
|
||||||
}
|
}
|
||||||
|
tasks.test {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
tasks.withType<KotlinCompile>() {
|
tasks.withType<KotlinCompile>() {
|
||||||
kotlinOptions.jvmTarget = "1.8"
|
kotlinOptions.jvmTarget = "1.8"
|
||||||
}
|
}
|
||||||
+3
@@ -14,6 +14,9 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
|
||||||
}
|
}
|
||||||
|
test {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
|
|||||||
+3
@@ -16,6 +16,9 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
testImplementation(kotlin("test-junit"))
|
testImplementation(kotlin("test-junit"))
|
||||||
}
|
}
|
||||||
|
tasks.test {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
tasks.withType<KotlinCompile>() {
|
tasks.withType<KotlinCompile>() {
|
||||||
kotlinOptions.jvmTarget = "1.8"
|
kotlinOptions.jvmTarget = "1.8"
|
||||||
}
|
}
|
||||||
|
|||||||
+3
@@ -28,6 +28,9 @@ kotlin {
|
|||||||
compilations.all {
|
compilations.all {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
|
testRuns["test"].executionTask.configure {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
withJava()
|
withJava()
|
||||||
}
|
}
|
||||||
js(LEGACY) {
|
js(LEGACY) {
|
||||||
|
|||||||
+3
@@ -28,6 +28,9 @@ kotlin {
|
|||||||
compilations.all {
|
compilations.all {
|
||||||
kotlinOptions.jvmTarget = "1.8"
|
kotlinOptions.jvmTarget = "1.8"
|
||||||
}
|
}
|
||||||
|
testRuns["test"].executionTask.configure {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
withJava()
|
withJava()
|
||||||
}
|
}
|
||||||
js(LEGACY) {
|
js(LEGACY) {
|
||||||
|
|||||||
+3
@@ -17,6 +17,9 @@ kotlin {
|
|||||||
compilations.all {
|
compilations.all {
|
||||||
kotlinOptions.jvmTarget = '1.8'
|
kotlinOptions.jvmTarget = '1.8'
|
||||||
}
|
}
|
||||||
|
testRuns["test"].executionTask.configure {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
js(LEGACY) {
|
js(LEGACY) {
|
||||||
browser {
|
browser {
|
||||||
|
|||||||
+3
@@ -15,6 +15,9 @@ kotlin {
|
|||||||
compilations.all {
|
compilations.all {
|
||||||
kotlinOptions.jvmTarget = "1.8"
|
kotlinOptions.jvmTarget = "1.8"
|
||||||
}
|
}
|
||||||
|
testRuns["test"].executionTask.configure {
|
||||||
|
useJUnit()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
js(LEGACY) {
|
js(LEGACY) {
|
||||||
browser {
|
browser {
|
||||||
|
|||||||
+6
@@ -13,6 +13,7 @@ object Versions {
|
|||||||
val GRADLE = version("6.3")
|
val GRADLE = version("6.3")
|
||||||
val KTOR: (kotlinVersion: Version) -> Version = { kotlinVersion -> version("1.3.2-$kotlinVersion") }
|
val KTOR: (kotlinVersion: Version) -> Version = { kotlinVersion -> version("1.3.2-$kotlinVersion") }
|
||||||
val JUNIT = version("4.12")
|
val JUNIT = version("4.12")
|
||||||
|
val JUNIT5 = version("5.6.0")
|
||||||
|
|
||||||
object ANDROID {
|
object ANDROID {
|
||||||
val ANDROID_MATERIAL = version("1.2.0")
|
val ANDROID_MATERIAL = version("1.2.0")
|
||||||
@@ -40,6 +41,11 @@ object Versions {
|
|||||||
object GRADLE_PLUGINS {
|
object GRADLE_PLUGINS {
|
||||||
val ANDROID = version("4.0.1")
|
val ANDROID = version("4.0.1")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
object MAVEN_PLUGINS {
|
||||||
|
val SUREFIRE = version("2.22.2")
|
||||||
|
val FAILSAFE = SUREFIRE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun version(version: String) = Version.fromString(version)
|
private fun version(version: String) = Version.fromString(version)
|
||||||
+10
-9
@@ -11,6 +11,7 @@ import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.MavenPrinter
|
|||||||
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.ModulePath
|
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.ModulePath
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.SourcesetType
|
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.SourcesetType
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.settings.version.Version
|
import org.jetbrains.kotlin.tools.projectWizard.settings.version.Version
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
interface DependencyIR : BuildSystemIR {
|
interface DependencyIR : BuildSystemIR {
|
||||||
val dependencyType: DependencyType
|
val dependencyType: DependencyType
|
||||||
@@ -26,7 +27,7 @@ data class ModuleDependencyIR(
|
|||||||
override fun withDependencyType(type: DependencyType): DependencyIR = copy(dependencyType = type)
|
override fun withDependencyType(type: DependencyType): DependencyIR = copy(dependencyType = type)
|
||||||
|
|
||||||
override fun BuildFilePrinter.render() = when (this) {
|
override fun BuildFilePrinter.render() = when (this) {
|
||||||
is GradlePrinter -> call(dependencyType.gradleName) {
|
is GradlePrinter -> call(dependencyType.getGradleName()) {
|
||||||
call("project", forceBrackets = true) {
|
call("project", forceBrackets = true) {
|
||||||
+path.parts.joinToString(separator = "") { ":$it" }.quotified
|
+path.parts.joinToString(separator = "") { ":$it" }.quotified
|
||||||
}
|
}
|
||||||
@@ -63,22 +64,22 @@ fun SourcesetType.toDependencyType() = when (this) {
|
|||||||
SourcesetType.test -> DependencyType.TEST
|
SourcesetType.test -> DependencyType.TEST
|
||||||
}
|
}
|
||||||
|
|
||||||
val DependencyType.gradleName
|
fun DependencyType.getGradleName(type: String = "implementation") = when (this) {
|
||||||
get() = when (this) {
|
DependencyType.MAIN -> type
|
||||||
DependencyType.MAIN -> "implementation"
|
DependencyType.TEST -> "test${type.capitalize(Locale.US)}"
|
||||||
DependencyType.TEST -> "testImplementation"
|
}
|
||||||
}
|
|
||||||
|
|
||||||
data class ArtifactBasedLibraryDependencyIR(
|
data class ArtifactBasedLibraryDependencyIR(
|
||||||
override val artifact: LibraryArtifact,
|
override val artifact: LibraryArtifact,
|
||||||
override val version: Version,
|
override val version: Version,
|
||||||
override val dependencyType: DependencyType
|
override val dependencyType: DependencyType,
|
||||||
|
val dependencyKind: String = "implementation"
|
||||||
) : LibraryDependencyIR {
|
) : LibraryDependencyIR {
|
||||||
override fun withDependencyType(type: DependencyType): ArtifactBasedLibraryDependencyIR =
|
override fun withDependencyType(type: DependencyType): ArtifactBasedLibraryDependencyIR =
|
||||||
copy(dependencyType = type)
|
copy(dependencyType = type)
|
||||||
|
|
||||||
override fun BuildFilePrinter.render() = when (this) {
|
override fun BuildFilePrinter.render() = when (this) {
|
||||||
is GradlePrinter -> call(dependencyType.gradleName) {
|
is GradlePrinter -> call(dependencyType.getGradleName(dependencyKind)) {
|
||||||
with(artifact) {
|
with(artifact) {
|
||||||
when (this) {
|
when (this) {
|
||||||
is MavenArtifact -> +"$groupId:$artifactId:${version}".quotified
|
is MavenArtifact -> +"$groupId:$artifactId:${version}".quotified
|
||||||
@@ -125,7 +126,7 @@ abstract class KotlinLibraryDependencyIR(
|
|||||||
|
|
||||||
override fun BuildFilePrinter.render() {
|
override fun BuildFilePrinter.render() {
|
||||||
when (this) {
|
when (this) {
|
||||||
is GradlePrinter -> call(dependencyType.gradleName) {
|
is GradlePrinter -> call(dependencyType.getGradleName()) {
|
||||||
if (GradlePrinter.GradleDsl.KOTLIN == dsl || isInMppModule) {
|
if (GradlePrinter.GradleDsl.KOTLIN == dsl || isInMppModule) {
|
||||||
+"kotlin("
|
+"kotlin("
|
||||||
+artifactName.quotified
|
+artifactName.quotified
|
||||||
|
|||||||
+2
@@ -42,6 +42,8 @@ class GradleIRListBuilder private constructor() : GradleIRBuilderBase {
|
|||||||
|
|
||||||
operator fun String.unaryPlus() = RawGradleIR { +this@unaryPlus }.also(irs::add)
|
operator fun String.unaryPlus() = RawGradleIR { +this@unaryPlus }.also(irs::add)
|
||||||
operator fun BuildSystemIR.unaryPlus() = also(irs::add)
|
operator fun BuildSystemIR.unaryPlus() = also(irs::add)
|
||||||
|
operator fun Collection<BuildSystemIR>.unaryPlus() = also(irs::addAll)
|
||||||
|
|
||||||
fun addRaw(raw: GradlePrinter.() -> Unit) = RawGradleIR(raw).also(irs::add)
|
fun addRaw(raw: GradlePrinter.() -> Unit) = RawGradleIR(raw).also(irs::add)
|
||||||
fun addRaw(@NonNls raw: String) = RawGradleIR { +raw }.also(irs::add)
|
fun addRaw(@NonNls raw: String) = RawGradleIR { +raw }.also(irs::add)
|
||||||
|
|
||||||
|
|||||||
+14
@@ -7,10 +7,12 @@ package org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.maven
|
|||||||
|
|
||||||
import org.jetbrains.annotations.NonNls
|
import org.jetbrains.annotations.NonNls
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.BuildSystemIR
|
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.BuildSystemIR
|
||||||
|
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.BuildSystemPluginIR
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.RepositoryWrapper
|
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.RepositoryWrapper
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.BuildFilePrinter
|
import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.BuildFilePrinter
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.MavenPrinter
|
import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.MavenPrinter
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.Repository
|
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.Repository
|
||||||
|
import org.jetbrains.kotlin.tools.projectWizard.settings.version.Version
|
||||||
|
|
||||||
interface MavenIR : BuildSystemIR {
|
interface MavenIR : BuildSystemIR {
|
||||||
fun MavenPrinter.renderMaven()
|
fun MavenPrinter.renderMaven()
|
||||||
@@ -31,6 +33,18 @@ data class PluginRepositoryMavenIR(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data class MavenOnlyPluginIR(
|
||||||
|
val artifactId: String,
|
||||||
|
val version: Version,
|
||||||
|
) : MavenIR, BuildSystemPluginIR {
|
||||||
|
override fun MavenPrinter.renderMaven() {
|
||||||
|
node("plugin") {
|
||||||
|
singleLineNode("artifactId") { +artifactId }
|
||||||
|
singleLineNode("version") { +version.text }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
data class MavenPropertyIR(
|
data class MavenPropertyIR(
|
||||||
@NonNls val name: String,
|
@NonNls val name: String,
|
||||||
@NonNls val value: String
|
@NonNls val value: String
|
||||||
|
|||||||
+5
@@ -196,6 +196,11 @@ object AndroidTargetConfigurator : TargetConfigurator,
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun createBuildFileIRs(reader: Reader, configurationData: ModulesToIrConversionData, module: Module): List<BuildSystemIR> =
|
||||||
|
buildList {
|
||||||
|
+super<AndroidModuleConfigurator>.createBuildFileIRs(reader, configurationData, module)
|
||||||
|
+super<ModuleConfiguratorWithTests>.createBuildFileIRs(reader, configurationData, module)
|
||||||
|
}
|
||||||
|
|
||||||
val androidPlugin by enumSetting<AndroidGradlePlugin>(
|
val androidPlugin by enumSetting<AndroidGradlePlugin>(
|
||||||
KotlinNewProjectWizardBundle.message("module.configurator.android.setting.android.plugin"),
|
KotlinNewProjectWizardBundle.message("module.configurator.android.setting.android.plugin"),
|
||||||
|
|||||||
+62
-20
@@ -7,20 +7,22 @@ package org.jetbrains.kotlin.tools.projectWizard.moduleConfigurators
|
|||||||
|
|
||||||
|
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.KotlinNewProjectWizardBundle
|
import org.jetbrains.kotlin.tools.projectWizard.KotlinNewProjectWizardBundle
|
||||||
|
import org.jetbrains.kotlin.tools.projectWizard.Versions
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.core.Reader
|
import org.jetbrains.kotlin.tools.projectWizard.core.Reader
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.core.entity.settings.ModuleConfiguratorSetting
|
import org.jetbrains.kotlin.tools.projectWizard.core.entity.settings.ModuleConfiguratorSetting
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.core.entity.settings.ModuleConfiguratorSettingReference
|
import org.jetbrains.kotlin.tools.projectWizard.core.entity.settings.ModuleConfiguratorSettingReference
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.core.safeAs
|
import org.jetbrains.kotlin.tools.projectWizard.core.safeAs
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.BuildSystemIR
|
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.*
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.DependencyType
|
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.gradle.irsList
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.KotlinArbitraryDependencyIR
|
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.maven.MavenOnlyPluginIR
|
||||||
|
import org.jetbrains.kotlin.tools.projectWizard.library.MavenArtifact
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.phases.GenerationPhase
|
import org.jetbrains.kotlin.tools.projectWizard.phases.GenerationPhase
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.plugins.buildSystem.BuildSystemType
|
import org.jetbrains.kotlin.tools.projectWizard.plugins.buildSystem.*
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.plugins.buildSystem.buildSystemType
|
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.plugins.kotlin.KotlinPlugin
|
import org.jetbrains.kotlin.tools.projectWizard.plugins.kotlin.KotlinPlugin
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.plugins.kotlin.ModuleType
|
import org.jetbrains.kotlin.tools.projectWizard.plugins.kotlin.ModuleType
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.plugins.kotlin.ModulesToIrConversionData
|
import org.jetbrains.kotlin.tools.projectWizard.plugins.kotlin.ModulesToIrConversionData
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.settings.DisplayableSettingItem
|
import org.jetbrains.kotlin.tools.projectWizard.settings.DisplayableSettingItem
|
||||||
|
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.DefaultRepository
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.Module
|
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.Module
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.ModuleKind
|
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.ModuleKind
|
||||||
|
|
||||||
@@ -54,59 +56,99 @@ interface ModuleConfiguratorWithTests : ModuleConfiguratorWithSettings {
|
|||||||
reader: Reader,
|
reader: Reader,
|
||||||
configurationData: ModulesToIrConversionData,
|
configurationData: ModulesToIrConversionData,
|
||||||
module: Module
|
module: Module
|
||||||
): List<BuildSystemIR> =
|
): List<BuildSystemIR> = irsList {
|
||||||
inContextOfModuleConfigurator(module) {
|
val testFramework = inContextOfModuleConfigurator(module) { reader { testFramework.reference.settingValue } }
|
||||||
reader {
|
|
||||||
testFramework.reference.settingValue.dependencyNames.map { dependencyName ->
|
testFramework.dependencyNames.forEach { dependencyName ->
|
||||||
KotlinArbitraryDependencyIR(
|
+KotlinArbitraryDependencyIR(
|
||||||
dependencyName,
|
dependencyName,
|
||||||
isInMppModule = module.kind
|
isInMppModule = module.kind
|
||||||
.let { it == ModuleKind.multiplatform || it == ModuleKind.target },
|
.let { it == ModuleKind.multiplatform || it == ModuleKind.target },
|
||||||
kotlinVersion = KotlinPlugin.version.propertyValue,
|
kotlinVersion = reader { KotlinPlugin.version.propertyValue },
|
||||||
dependencyType = DependencyType.TEST
|
dependencyType = DependencyType.TEST
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
testFramework.additionalDependencies.forEach { +it }
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun createBuildFileIRs(reader: Reader, configurationData: ModulesToIrConversionData, module: Module) = irsList {
|
||||||
|
val testFramework = inContextOfModuleConfigurator(module) { reader { testFramework.reference.settingValue } }
|
||||||
|
val buildSystemType = reader { buildSystemType }
|
||||||
|
if (testFramework != KotlinTestFramework.NONE) {
|
||||||
|
when {
|
||||||
|
module.kind.isSingleplatform && buildSystemType.isGradle -> {
|
||||||
|
testFramework.usePlatform?.let { usePlatform ->
|
||||||
|
val testTaskAccess = if (buildSystemType == BuildSystemType.GradleKotlinDsl) "tasks.test" else "test"
|
||||||
|
testTaskAccess {
|
||||||
|
+"$usePlatform()"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
buildSystemType == BuildSystemType.Maven -> {
|
||||||
|
+MavenOnlyPluginIR("maven-surefire-plugin", Versions.MAVEN_PLUGINS.SUREFIRE)
|
||||||
|
+MavenOnlyPluginIR("maven-failsafe-plugin", Versions.MAVEN_PLUGINS.FAILSAFE)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun getConfiguratorSettings(): List<ModuleConfiguratorSetting<*, *>> = listOf(testFramework)
|
override fun getConfiguratorSettings(): List<ModuleConfiguratorSetting<*, *>> = listOf(testFramework)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
enum class KotlinTestFramework(
|
enum class KotlinTestFramework(
|
||||||
override val text: String,
|
override val text: String,
|
||||||
val moduleTypes: List<ModuleType>,
|
val moduleTypes: List<ModuleType>,
|
||||||
val dependencyNames: List<String>
|
val usePlatform: String?,
|
||||||
|
val dependencyNames: List<String>,
|
||||||
|
val additionalDependencies: List<LibraryDependencyIR> = emptyList()
|
||||||
) : DisplayableSettingItem {
|
) : DisplayableSettingItem {
|
||||||
NONE(
|
NONE(
|
||||||
KotlinNewProjectWizardBundle.message("module.configurator.tests.setting.framework.none"),
|
KotlinNewProjectWizardBundle.message("module.configurator.tests.setting.framework.none"),
|
||||||
ModuleType.ALL.toList(),
|
ModuleType.ALL.toList(),
|
||||||
|
usePlatform = null,
|
||||||
emptyList()
|
emptyList()
|
||||||
),
|
),
|
||||||
JUNIT4(
|
JUNIT4(
|
||||||
KotlinNewProjectWizardBundle.message("module.configurator.tests.setting.framework.junit4"),
|
KotlinNewProjectWizardBundle.message("module.configurator.tests.setting.framework.junit4"),
|
||||||
listOf(ModuleType.jvm, ModuleType.android),
|
listOf(ModuleType.jvm, ModuleType.android),
|
||||||
|
usePlatform = "useJUnit",
|
||||||
listOf("test-junit")
|
listOf("test-junit")
|
||||||
),
|
),
|
||||||
JUNIT5(
|
JUNIT5(
|
||||||
KotlinNewProjectWizardBundle.message("module.configurator.tests.setting.framework.junit5"),
|
KotlinNewProjectWizardBundle.message("module.configurator.tests.setting.framework.junit5"),
|
||||||
listOf(ModuleType.jvm),
|
listOf(ModuleType.jvm),
|
||||||
listOf("test-junit5")
|
usePlatform = "useJUnitPlatform",
|
||||||
|
dependencyNames = listOf("test-junit5"),
|
||||||
|
additionalDependencies = listOf(
|
||||||
|
ArtifactBasedLibraryDependencyIR(
|
||||||
|
MavenArtifact(DefaultRepository.MAVEN_CENTRAL, "org.junit.jupiter", "junit-jupiter-api"),
|
||||||
|
version = Versions.JUNIT5,
|
||||||
|
dependencyType = DependencyType.TEST,
|
||||||
|
),
|
||||||
|
ArtifactBasedLibraryDependencyIR(
|
||||||
|
MavenArtifact(DefaultRepository.MAVEN_CENTRAL, "org.junit.jupiter", "junit-jupiter-engine"),
|
||||||
|
version = Versions.JUNIT5,
|
||||||
|
dependencyType = DependencyType.TEST,
|
||||||
|
dependencyKind = "runtimeOnly"
|
||||||
|
),
|
||||||
|
)
|
||||||
),
|
),
|
||||||
TEST_NG(
|
TEST_NG(
|
||||||
KotlinNewProjectWizardBundle.message("module.configurator.tests.setting.framework.test.ng"),
|
KotlinNewProjectWizardBundle.message("module.configurator.tests.setting.framework.test.ng"),
|
||||||
listOf(ModuleType.jvm),
|
listOf(ModuleType.jvm),
|
||||||
|
usePlatform = "useTestNG",
|
||||||
listOf("test-testng")
|
listOf("test-testng")
|
||||||
),
|
),
|
||||||
JS(
|
JS(
|
||||||
KotlinNewProjectWizardBundle.message("module.configurator.tests.setting.framework.js"),
|
KotlinNewProjectWizardBundle.message("module.configurator.tests.setting.framework.js"),
|
||||||
listOf(ModuleType.js),
|
listOf(ModuleType.js),
|
||||||
|
usePlatform = null,
|
||||||
listOf("test-js")
|
listOf("test-js")
|
||||||
),
|
),
|
||||||
COMMON(
|
COMMON(
|
||||||
KotlinNewProjectWizardBundle.message("module.configurator.tests.setting.framework.common"),
|
KotlinNewProjectWizardBundle.message("module.configurator.tests.setting.framework.common"),
|
||||||
listOf(ModuleType.common),
|
listOf(ModuleType.common),
|
||||||
|
usePlatform = null,
|
||||||
listOf("test-common", "test-annotations-common")
|
listOf("test-common", "test-annotations-common")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-5
@@ -29,13 +29,17 @@ class RealNativeTargetConfigurator private constructor(
|
|||||||
override val isIosTarget: Boolean
|
override val isIosTarget: Boolean
|
||||||
get() = moduleSubType.isIOS
|
get() = moduleSubType.isIOS
|
||||||
|
|
||||||
override fun createInnerTargetIrs(reader: Reader, module: Module): List<BuildSystemIR> = if (moduleSubType.isIOS) irsList {
|
override fun createInnerTargetIrs(reader: Reader, module: Module): List<BuildSystemIR> = irsList {
|
||||||
"binaries" {
|
+super<SimpleTargetConfigurator>.createInnerTargetIrs(reader, module)
|
||||||
"framework" {
|
if (moduleSubType.isIOS) {
|
||||||
"baseName" assign const(module.parent!!.name)
|
"binaries" {
|
||||||
|
"framework" {
|
||||||
|
"baseName" assign const(module.parent!!.name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else emptyList()
|
}
|
||||||
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val configurators = ModuleSubType.values()
|
val configurators = ModuleSubType.values()
|
||||||
|
|||||||
+10
@@ -25,6 +25,7 @@ import org.jetbrains.kotlin.tools.projectWizard.phases.GenerationPhase
|
|||||||
import org.jetbrains.kotlin.tools.projectWizard.plugins.buildSystem.buildSystemType
|
import org.jetbrains.kotlin.tools.projectWizard.plugins.buildSystem.buildSystemType
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.plugins.buildSystem.isGradle
|
import org.jetbrains.kotlin.tools.projectWizard.plugins.buildSystem.isGradle
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.plugins.kotlin.ModuleSubType
|
import org.jetbrains.kotlin.tools.projectWizard.plugins.kotlin.ModuleSubType
|
||||||
|
import org.jetbrains.kotlin.tools.projectWizard.plugins.kotlin.ModulesToIrConversionData
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.settings.DisplayableSettingItem
|
import org.jetbrains.kotlin.tools.projectWizard.settings.DisplayableSettingItem
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.Module
|
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.Module
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.ModuleKind
|
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.ModuleKind
|
||||||
@@ -162,6 +163,7 @@ object JvmTargetConfigurator : JvmModuleConfigurator,
|
|||||||
reader: Reader,
|
reader: Reader,
|
||||||
module: Module
|
module: Module
|
||||||
): List<BuildSystemIR> = irsList {
|
): List<BuildSystemIR> = irsList {
|
||||||
|
+super<SimpleTargetConfigurator>.createInnerTargetIrs(reader, module)
|
||||||
reader {
|
reader {
|
||||||
inContextOfModuleConfigurator(module) {
|
inContextOfModuleConfigurator(module) {
|
||||||
val targetVersionValue = JvmModuleConfigurator.targetJvmVersion.reference.settingValue.value
|
val targetVersionValue = JvmModuleConfigurator.targetJvmVersion.reference.settingValue.value
|
||||||
@@ -175,6 +177,14 @@ object JvmTargetConfigurator : JvmModuleConfigurator,
|
|||||||
"withJava"()
|
"withJava"()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
val testFramework = inContextOfModuleConfigurator(module) { ModuleConfiguratorWithTests.testFramework.reference.settingValue }
|
||||||
|
if (testFramework != KotlinTestFramework.NONE) {
|
||||||
|
testFramework.usePlatform?.let { usePlatform ->
|
||||||
|
"testRuns[\"test\"].executionTask.configure" {
|
||||||
|
+"$usePlatform()"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
@@ -90,6 +90,7 @@ object JvmSinglePlatformModuleConfigurator : JvmModuleConfigurator,
|
|||||||
module: Module
|
module: Module
|
||||||
): List<BuildSystemIR> =
|
): List<BuildSystemIR> =
|
||||||
buildList {
|
buildList {
|
||||||
|
+super<JvmModuleConfigurator>.createBuildFileIRs(reader, configurationData, module)
|
||||||
if (configurationData.buildSystemType == BuildSystemType.GradleKotlinDsl) {
|
if (configurationData.buildSystemType == BuildSystemType.GradleKotlinDsl) {
|
||||||
+GradleImportIR("org.jetbrains.kotlin.gradle.tasks.KotlinCompile")
|
+GradleImportIR("org.jetbrains.kotlin.gradle.tasks.KotlinCompile")
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-7
@@ -17,19 +17,20 @@ import org.jetbrains.kotlin.tools.projectWizard.settings.DisplayableSettingItem
|
|||||||
import org.jetbrains.kotlin.tools.projectWizard.templates.Template
|
import org.jetbrains.kotlin.tools.projectWizard.templates.Template
|
||||||
|
|
||||||
@Suppress("EnumEntryName")
|
@Suppress("EnumEntryName")
|
||||||
enum class ModuleKind : DisplayableSettingItem {
|
enum class ModuleKind(val isSingleplatform: Boolean) : DisplayableSettingItem {
|
||||||
multiplatform,
|
multiplatform(isSingleplatform = false),
|
||||||
target,
|
target(isSingleplatform = false),
|
||||||
singleplatformJvm,
|
singleplatformJvm(isSingleplatform = true),
|
||||||
singleplatformAndroid,
|
singleplatformAndroid(isSingleplatform = true),
|
||||||
singleplatformJsBrowser,
|
singleplatformJsBrowser(isSingleplatform = true),
|
||||||
singleplatformJsNode,
|
singleplatformJsNode(isSingleplatform = true),
|
||||||
;
|
;
|
||||||
|
|
||||||
override val text: String
|
override val text: String
|
||||||
get() = name
|
get() = name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO separate to classes
|
// TODO separate to classes
|
||||||
class Module(
|
class Module(
|
||||||
@NonNls var name: String,
|
@NonNls var name: String,
|
||||||
|
|||||||
Reference in New Issue
Block a user