Skip to content

Commit

Permalink
Merge pull request #111 from touchlab/hfhbd-main
Browse files Browse the repository at this point in the history
Hfhbd main
  • Loading branch information
kpgalligan authored Nov 5, 2023
2 parents 7d8009f + 38ef620 commit 4deea8d
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 45 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,5 @@ jobs:
- name: Build
run: ./gradlew build --no-daemon --stacktrace

- name: Build Old Memory Model
run: ./gradlew build --no-daemon --stacktrace -Pkotlin.native.binary.memoryModel=experimental
env:
GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m"
18 changes: 2 additions & 16 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,9 @@ jobs:
shell: bash
run: |
echo "c:\msys64\mingw64\bin" >> $GITHUB_PATH
- name: Publish Mac Artifacts
- name: Publish
if: matrix.os == 'macOS-latest'
run: ./gradlew publishMac --no-daemon --stacktrace
env:
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
- name: Publish Windows Artifacts
if: matrix.os == 'windows-latest'
run: ./gradlew publishWindows --no-daemon --stacktrace
env:
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
- name: Publish Linux Artifacts
if: matrix.os == 'ubuntu-18.04'
run: ./gradlew publishLinux --no-daemon --stacktrace
run: ./gradlew publish --no-daemon --stacktrace
env:
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
Expand Down
8 changes: 0 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +0,0 @@
allprojects {
repositories {
mavenLocal()
mavenCentral()
google()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
}
}
8 changes: 8 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ pluginManagement {
}
}

dependencyResolutionManagement {
repositories {
mavenLocal()
mavenCentral()
google()
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
}
}
38 changes: 20 additions & 18 deletions sqliter-driver/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ fun configInterop(target: org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTar
"-linker-options",
"-lsqlite3 -L/usr/lib/x86_64-linux-gnu -L/usr/lib"
)

HostManager.hostIsMingw -> listOf("-linker-options", "-lsqlite3 -Lc:\\msys64\\mingw64\\lib")
else -> listOf("-linker-options", "-lsqlite3")
}
Expand All @@ -46,6 +47,7 @@ kotlin {
watchosDeviceArm64(),
mingwX64(),
linuxX64(),
linuxArm64(),
)

knTargets
Expand All @@ -63,7 +65,6 @@ kotlin {
}
commonMain {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-common")
}
}
commonTest {
Expand All @@ -78,10 +79,16 @@ kotlin {
val appleMain = sourceSets.maybeCreate("appleMain").apply {
dependsOn(nativeCommonMain)
}
val linuxMain = sourceSets.maybeCreate("linuxX64Main").apply {
val linuxMain = sourceSets.maybeCreate("linuxMain").apply {
dependsOn(nativeCommonMain)
}

val linuxX64Main = sourceSets.maybeCreate("linuxX64Main").apply {
dependsOn(linuxMain)
}
val linuxArm64Main = sourceSets.maybeCreate("linuxArm64Main").apply {
dependsOn(linuxMain)
}

val mingwMain = sourceSets.maybeCreate("mingwMain").apply {
dependsOn(nativeCommonMain)
}
Expand All @@ -96,9 +103,11 @@ kotlin {
target.compilations.getByName("main").defaultSourceSet.dependsOn(mingwMain)
target.compilations.getByName("test").defaultSourceSet.dependsOn(nativeCommonTest)
}

target.name.startsWith("linux") -> {
target.compilations.getByName("test").defaultSourceSet.dependsOn(nativeCommonTest)
}

else -> {
target.compilations.getByName("main").defaultSourceSet.dependsOn(appleMain)
target.compilations.getByName("test").defaultSourceSet.dependsOn(nativeCommonTest)
Expand All @@ -112,20 +121,13 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile> {
kotlinOptions.freeCompilerArgs += "-Xexpect-actual-classes"
}

if(!HostManager.hostIsLinux) {
tasks.findByName("linuxX64Test")?.enabled = false
tasks.findByName("linkDebugTestLinuxX64")?.enabled = false
tasks.findByName("publishLinuxX64PublicationToMavenRepository")?.enabled = false
}

if(!HostManager.hostIsMingw) {
tasks.findByName("mingwX64Test")?.enabled = false
tasks.findByName("linkDebugTestMingwX64")?.enabled = false
tasks.findByName("publishMingwX64PublicationToMavenRepository")?.enabled = false
}
listOf(
"linuxX64Test",
"linuxArm64Test",
"linkDebugTestLinuxX64",
"linkDebugTestLinuxArm64",
"mingwX64Test",
"linkDebugTestMingwX64",
).forEach { tasks.findByName(it)?.enabled = false }

apply(from = "../gradle/gradle-mvn-mpp-push.gradle")

tasks.register("publishMac"){
setDependsOn(tasks.filter { t -> t.name.startsWith("publish") && t.name.endsWith("ToMavenRepository") && !t.name.contains("Linux") }.map { it.name })
}

0 comments on commit 4deea8d

Please sign in to comment.