diff --git a/SQLiter/build.gradle b/SQLiter/build.gradle index 9a22192e..a70ee9b5 100644 --- a/SQLiter/build.gradle +++ b/SQLiter/build.gradle @@ -23,17 +23,31 @@ buildscript { dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION" + classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.9.3" } } apply plugin: 'org.jetbrains.kotlin.multiplatform' +apply plugin: 'com.jfrog.artifactory' repositories { mavenCentral() + + maven { + url 'https://oss.sonatype.org/content/repositories/snapshots/' + } + + maven { + url System.getenv("ARTIFACTORY_PUBLISH_URL") + credentials { + username System.getenv("ARTIFACTORY_USER") + password System.getenv("ARTIFACTORY_PASSWORD") + } + } } group = GROUP -version = VERSION_NAME +version = VERSION_NAME + "." + System.getenv("PG_BUILD_NUMBER") kotlin { targets { @@ -50,11 +64,9 @@ kotlin { } fromPreset(presets.mingwX64, 'mingw'){ - compilations.each { + compilations.test { it.extraOpts("-linker-options", "-Lc:\\msys64\\mingw64\\lib") it.extraOpts("-linker-options", "-lsqlite3") - } - compilations.test { it.extraOpts("-native-library", "../KotlinCpp/bcdist/mingw_x64/tlruntime.bc") } } @@ -84,7 +96,7 @@ kotlin { sourceSets { commonMain { dependencies { - implementation "co.touchlab:stately:$STATELY_VERSION" + implementation "co.touchlab:stately:$STATELY_VERSION" + "." + System.getenv("PG_BUILD_NUMBER") implementation 'org.jetbrains.kotlin:kotlin-stdlib-common' } } @@ -152,6 +164,7 @@ void mergeCppOutput(String archFolder, String archZip){ task mergeCppAll(dependsOn:build) { doLast { + println("merge output all") mergeCppOutput("iosArm32", "ios_arm32") mergeCppOutput("iosArm64", "ios_arm64") mergeCppOutput("iosX64", "ios_x64") @@ -160,9 +173,46 @@ task mergeCppAll(dependsOn:build) { } } +task mergeCppiOSArm32(dependsOn:compileKotlinIosArm32) { + doLast { + println("merge output ios arm32") + mergeCppOutput("iosArm32", "ios_arm32") + } +} +task mergeCppiOSArm64(dependsOn:compileKotlinIosArm64) { + doLast { + println("merge output ios arm64") + mergeCppOutput("iosArm64", "ios_arm64") + } +} + +task mergeCppiOSX64(dependsOn:compileKotlinIosX64) { + doLast { + println("merge output ios x64") + mergeCppOutput("iosX64", "ios_x64") + } +} + +task mergeCppMingw(dependsOn:compileKotlinMingw) { + doLast { + println("merge output mingw") + mergeCppOutput("mingw", "mingw_x64") + } +} apply from: "$rootDir/gradle/gradle-mvn-mpp-push.gradle" + tasks.findByName("publish").dependsOn("mergeCppAll") -tasks.findByName("publishToMavenLocal").dependsOn("mergeCppAll") \ No newline at end of file +tasks.findByName("publishToMavenLocal").dependsOn("mergeCppAll") + +if (System.getenv("BUILD_HOST") == 'macos') { + tasks.findByName("publishIosArm32PublicationToSqliterRepository").dependsOn("mergeCppiOSArm32") + tasks.findByName("publishIosArm64PublicationToSqliterRepository").dependsOn("mergeCppiOSArm64") + tasks.findByName("publishIosX64PublicationToSqliterRepository").dependsOn("mergeCppiOSX64") +} + +if (System.getenv("BUILD_HOST") == 'windows') { + tasks.findByName("publishMingwPublicationToSqliterRepository").dependsOn("mergeCppMingw") +} diff --git a/SQLiter/gradle.properties b/SQLiter/gradle.properties index 3a98b80a..d96701b4 100644 --- a/SQLiter/gradle.properties +++ b/SQLiter/gradle.properties @@ -20,7 +20,7 @@ GROUP=co.touchlab VERSION_NAME=0.6.2 STATELY_VERSION=0.7.2 -KOTLIN_VERSION=1.3.31 +KOTLIN_VERSION=1.3.40 POM_URL=https://github.com/touchlab/SQLiter POM_DESCRIPTION=Simple SQLite Driver diff --git a/SQLiter/gradle/gradle-mvn-mpp-push.gradle b/SQLiter/gradle/gradle-mvn-mpp-push.gradle index 89434c72..b557aed5 100644 --- a/SQLiter/gradle/gradle-mvn-mpp-push.gradle +++ b/SQLiter/gradle/gradle-mvn-mpp-push.gradle @@ -80,18 +80,16 @@ publishing { } } + repositories { maven { - url isReleaseBuild() ? getReleaseRepositoryUrl() : getSnapshotRepositoryUrl() + name 'sqliter' + url System.getenv("ARTIFACTORY_PUBLISH_URL") credentials { - username getRepositoryUsername() - password getRepositoryPassword() + username System.getenv("ARTIFACTORY_USER") + password System.getenv("ARTIFACTORY_PASSWORD") } } - maven { - name 'test' - url "file://${rootProject.buildDir}/localMaven" - } } }