Skip to content

Commit

Permalink
Merge pull request #223 from arkivanov/disable-linuxArm32-for-corouti…
Browse files Browse the repository at this point in the history
…nes-interop

Disabled linuxArm32 target for coroutines-interop
  • Loading branch information
Arkadii Ivanov authored Oct 7, 2019
2 parents 1b63ae4 + 4d03942 commit e563b72
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 106 deletions.
72 changes: 49 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,37 +53,60 @@ void setupMultiplatformLibrary(Project project) {
}
}

void setupAllTargetsWithDefaultSourceSets(Project project) {
void setupAllTargetsWithDefaultSourceSets(Map parameters) {
setupAllTargetsWithDefaultSourceSets(
parameters['project'],
parameters.getOrDefault('isLinuxArm32HfpEnabled', true)
)
}

void setupAllTargetsWithDefaultSourceSets(Project project, Boolean isLinuxArm32HfpEnabled = true) {
final target = Target.currentTarget()

if (target.isCommon() || target.isMeta()) {
setupCommonTargets(project)
setupAndroidTarget(project)
setupJvmTarget(project)
setupJsTarget(project)
setupLinuxX64Target(project)
if (isLinuxArm32HfpEnabled) {
setupLinuxArm32HfpTarget(project)
}

project.kotlin {
sourceSets {
jvmJsCommonMain.dependsOn commonMain
jvmJsCommonTest.dependsOn commonTest

jvmMain.dependsOn jvmJsCommonMain
jvmTest.dependsOn jvmJsCommonTest
jvmNativeCommonMain.dependsOn commonMain
jvmNativeCommonTest.dependsOn commonTest

jvmCommonMain.dependsOn jvmJsCommonMain
jvmCommonMain.dependsOn jvmNativeCommonMain
jvmCommonTest.dependsOn jvmJsCommonTest
jvmCommonTest.dependsOn jvmNativeCommonTest

androidMain.dependsOn jvmMain
androidTest.dependsOn jvmTest
jvmMain.dependsOn jvmCommonMain
jvmTest.dependsOn jvmCommonTest

androidMain.dependsOn jvmCommonMain
androidTest.dependsOn jvmCommonTest

jsMain.dependsOn jvmJsCommonMain
jsTest.dependsOn jvmJsCommonTest

nativeCommonMain.dependsOn commonMain
nativeCommonTest.dependsOn commonTest
nativeCommonMain.dependsOn jvmNativeCommonMain
nativeCommonTest.dependsOn jvmNativeCommonTest

linuxCommonMain.dependsOn nativeCommonMain
linuxCommonTest.dependsOn nativeCommonTest

linuxX64Main.dependsOn linuxCommonMain
linuxX64Test.dependsOn linuxCommonTest

linuxArm32HfpMain.dependsOn linuxCommonMain
linuxArm32HfpTest.dependsOn linuxCommonTest
if (isLinuxArm32HfpEnabled) {
linuxArm32HfpMain.dependsOn linuxCommonMain
linuxArm32HfpTest.dependsOn linuxCommonTest
}
}
}
}
Expand All @@ -93,8 +116,11 @@ void setupAllTargetsWithDefaultSourceSets(Project project) {

project.kotlin {
sourceSets {
nativeCommonMain.dependsOn commonMain
nativeCommonTest.dependsOn commonTest
jvmNativeCommonMain.dependsOn commonMain
jvmNativeCommonTest.dependsOn commonTest

nativeCommonMain.dependsOn jvmNativeCommonMain
nativeCommonTest.dependsOn jvmNativeCommonTest

iosCommonMain.dependsOn nativeCommonMain
iosCommonTest.dependsOn nativeCommonTest
Expand All @@ -112,7 +138,7 @@ void setupAllTargetsWithDefaultSourceSets(Project project) {
}
}

void setupAndroidTarget(Project project) {
private void setupAndroidTarget(Project project) {
project.apply plugin: 'com.android.library'

project.android {
Expand Down Expand Up @@ -147,7 +173,7 @@ void setupAndroidTarget(Project project) {
}
}

void setupJvmTarget(Project project) {
private void setupJvmTarget(Project project) {
project.kotlin {
targets.fromPreset(presets.jvm, 'jvm')

Expand All @@ -168,27 +194,27 @@ void setupJvmTarget(Project project) {
}


void setupJsTarget(Project project) {
private void setupJsTarget(Project project) {
project.apply plugin: JsPlugin
}

void setupLinuxTargets(Project project) {
private void setupLinuxX64Target(Project project) {
project.kotlin {
targets {
fromPreset(presets.linuxX64, 'linuxX64')
fromPreset(presets.linuxArm32Hfp, 'linuxArm32Hfp')
}
}
}

void setupCommonTargets(Project project) {
setupAndroidTarget(project)
setupJvmTarget(project)
setupJsTarget(project)
setupLinuxTargets(project)
private void setupLinuxArm32HfpTarget(Project project) {
project.kotlin {
targets {
fromPreset(presets.linuxArm32Hfp, 'linuxArm32Hfp')
}
}
}

void setupIosTargets(Project project) {
private void setupIosTargets(Project project) {
project.apply plugin: IosPlugin
}

Expand Down
2 changes: 1 addition & 1 deletion coroutines-interop/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
setupMultiplatformLibrary(project)
setupAllTargetsWithDefaultSourceSets(project)
setupAllTargetsWithDefaultSourceSets(project: project, isLinuxArm32HfpEnabled: false)

kotlin {
targets {
Expand Down
2 changes: 1 addition & 1 deletion reaktive-testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ kotlin {
}
}

jvmMain {
jvmCommonMain {
dependencies {
implementation kotlin('test-junit')
}
Expand Down
93 changes: 12 additions & 81 deletions reaktive/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
setupMultiplatformLibrary(project)
setupAllTargetsWithDefaultSourceSets(project)

kotlin {
targets {
// fromPreset(presets.jvm, 'jvmCommon')
// fromPreset(presets.jvm, 'jvmJsCommon')
// fromPreset(presets.linuxX64, 'jvmNativeCommon')
// fromPreset(presets.linuxX64, 'nativeCommon')
// fromPreset(presets.linuxArm32Hfp, 'nativeCommon')
// fromPreset(presets.linuxX64, 'linuxCommon')

// fromPreset(presets.iosX64, 'iosCommon')
}

sourceSets {
commonMain {
dependencies {
Expand All @@ -17,85 +29,4 @@ kotlin {
}
}

final target = Target.currentTarget()

if (target.isCommon() || target.isMeta()) {
setupCommonTargets(project)

kotlin {
targets {
// fromPreset(presets.jvm, 'jvmCommon')
// fromPreset(presets.jvm, 'jvmJsCommon')
// fromPreset(presets.linuxX64, 'jvmNativeCommon')
// fromPreset(presets.linuxX64, 'nativeCommon')
// fromPreset(presets.linuxArm32Hfp, 'nativeCommon')
// fromPreset(presets.linuxX64, 'linuxCommon')
}

sourceSets {
jvmJsCommonMain.dependsOn commonMain
jvmJsCommonTest.dependsOn commonTest

jvmNativeCommonMain.dependsOn commonMain
jvmNativeCommonTest.dependsOn commonTest

jvmCommonMain.dependsOn jvmJsCommonMain
jvmCommonMain.dependsOn jvmNativeCommonMain
jvmCommonTest.dependsOn jvmJsCommonTest
jvmCommonTest.dependsOn jvmNativeCommonTest

jvmMain.dependsOn jvmCommonMain
jvmTest.dependsOn jvmCommonTest

androidMain.dependsOn jvmCommonMain
androidTest.dependsOn jvmCommonTest

jsMain.dependsOn jvmJsCommonMain
jsTest.dependsOn jvmJsCommonTest

nativeCommonMain.dependsOn jvmNativeCommonMain
nativeCommonTest.dependsOn jvmNativeCommonTest

linuxCommonMain.dependsOn nativeCommonMain
linuxCommonTest.dependsOn nativeCommonTest

linuxX64Main.dependsOn linuxCommonMain
linuxX64Test.dependsOn linuxCommonTest

linuxArm32HfpMain.dependsOn linuxCommonMain
linuxArm32HfpTest.dependsOn linuxCommonTest
}
}
}

if (target.isIos() || target.isMeta()) {
setupIosTargets(project)

kotlin {
targets {
// fromPreset(presets.iosX64, 'iosCommon')
}

sourceSets {
jvmNativeCommonMain.dependsOn commonMain
jvmNativeCommonTest.dependsOn commonTest

nativeCommonMain.dependsOn jvmNativeCommonMain
nativeCommonTest.dependsOn jvmNativeCommonTest

iosCommonMain.dependsOn nativeCommonMain
iosCommonTest.dependsOn nativeCommonTest

ios32Main.dependsOn iosCommonMain
ios32Test.dependsOn iosCommonTest

ios64Main.dependsOn iosCommonMain
ios64Test.dependsOn iosCommonTest

iosSimMain.dependsOn iosCommonMain
iosSimTest.dependsOn iosCommonTest
}
}
}

apply plugin: PublishPlugin

0 comments on commit e563b72

Please sign in to comment.