Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
madadam committed Nov 7, 2024
2 parents fa95f00 + a121ed5 commit 9da8a85
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 58 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
name: [android, linux, windows]
include:
- name: android
os: ubuntu-latest
os: ubuntu-24.04
cargo-command: cross
cargo-dir: ~/.cargo
target: aarch64-linux-android

- name: linux
os: ubuntu-latest
os: ubuntu-24.04
cargo-command: cargo
cargo-dir: ~/.cargo

Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:

check_kotlin_bindings:
name: check kotlin bindings
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -160,7 +160,7 @@ jobs:

check_dart_bindings:
name: check dart bindings
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

Expand Down
56 changes: 15 additions & 41 deletions bindings/dart/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
group = "org.equalitie.ouisync.lib"
version = "1.0-SNAPSHOT"

buildscript {
ext.kotlin_version = "2.0.20"
repositories {
Expand All @@ -13,39 +10,34 @@ buildscript {
}

dependencies {
classpath("com.android.tools.build:gradle:8.5.2")
classpath("com.android.tools.build:gradle:8.7.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
classpath("org.mozilla.rust-android-gradle:plugin:0.9.4")
}
}

plugins {
id "com.android.library"
id "kotlin-android"
id "org.mozilla.rust-android-gradle.rust-android" version '0.9.4'
}

allprojects {
repositories {
google()
mavenCentral()
}
}

apply plugin: "com.android.library"
apply plugin: "kotlin-android"
apply plugin: "org.mozilla.rust-android-gradle.rust-android"
group = "org.equalitie.ouisync.lib"
version = "1.0-SNAPSHOT"

android {
if (project.android.hasProperty("namespace")) {
namespace = "org.equalitie.ouisync.lib"
}

compileSdk = 34
ndkVersion "27.1.12297006"

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
}
ndkVersion = '27.2.12479018'

sourceSets {
main.java.srcDirs += "src/main/kotlin"
Expand All @@ -54,7 +46,11 @@ android {

defaultConfig {
minSdk = 21
targetSdkVersion = 35
targetSdkVersion = 34
}

kotlin {
jvmToolchain(17)
}

buildTypes {
Expand Down Expand Up @@ -118,28 +114,6 @@ cargo {
profile = gradle.startParameter.taskNames.any{it.toLowerCase().contains("debug")} ? "debug" : "release"

extraCargoBuildArguments = ['-p', 'ouisync-ffi']

// HACK: Recent NDK (since r23) no longer links `libgcc`, which breaks some libraries since
// they depended on the symbols from `libclang_rt.builtins-x86_64-android`
// (e.g. `__extenddftf2`, ...). To work around it, we link the library explicitly by setting
// it through the RUSTFLAGS env variable.
// More info: https://github.com/bbqsrc/cargo-ndk/issues/94.
exec { spec, toolchain ->
if (toolchain.target == 'x86_64-linux-android') {
def os_toolchain
if (System.properties['os.name'].toLowerCase().contains('windows')) {
os_toolchain = 'windows-x86_64'
} else {
os_toolchain = 'linux-x86_64'
}


def clangVersion = '18'
def libDir = "${android.sdkDirectory}/ndk/${android.ndkVersion}/toolchains/llvm/prebuilt/${os_toolchain}/lib/clang/${clangVersion}/lib/linux"

spec.environment('RUSTFLAGS', "-L${libDir} -lstatic=clang_rt.builtins-x86_64-android")
}
}
}

preBuild.dependsOn 'cargoBuild'
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion bindings/kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:8.7.0'
classpath 'com.android.tools.build:gradle:8.7.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
2 changes: 1 addition & 1 deletion bindings/kotlin/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
15 changes: 5 additions & 10 deletions bindings/kotlin/lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ version = rootProject.version
group = rootProject.group

android {
compileSdkVersion 34
ndkVersion "27.1.12297006"

namespace 'org.equalitie.ouisync.lib'

compileSdk = 34
ndkVersion = '27.2.12479018'

sourceSets {
main {
kotlin {
Expand All @@ -42,13 +42,8 @@ android {
versionName version
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '17'
kotlin {
jvmToolchain(17)
}

testOptions {
Expand Down

0 comments on commit 9da8a85

Please sign in to comment.