Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuff to allow us to publish internally to artifactory #4

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 56 additions & 6 deletions SQLiter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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")
}
}
Expand Down Expand Up @@ -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'
}
}
Expand Down Expand Up @@ -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")
Expand All @@ -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")
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")
}
2 changes: 1 addition & 1 deletion SQLiter/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 5 additions & 7 deletions SQLiter/gradle/gradle-mvn-mpp-push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}