diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3748eccbd3..5ef4e3c6df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -241,8 +241,6 @@ jobs: - name: Checkout Code if: matrix.should_run == true uses: actions/checkout@v3 - with: - submodules: recursive - name: Setup swap if: matrix.ghc == '8.10.7' && matrix.should_run == true @@ -920,8 +918,6 @@ jobs: steps: - name: Checkout Code uses: actions/checkout@v3 - with: - submodules: recursive - name: Point Command Line Tools SDK to Xcode SDK shell: bash @@ -1272,8 +1268,6 @@ jobs: steps: - name: Checkout Code uses: actions/checkout@v3 - with: - submodules: recursive - name: Prepare build id: prepare diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 38bfea49c2..0000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "apps/multiplatform/external/nanohttpd/upstream"] - path = apps/multiplatform/external/nanohttpd/upstream - url = https://github.com/NanoHttpd/nanohttpd diff --git a/apps/multiplatform/.gitignore b/apps/multiplatform/.gitignore index 4762a9f2f4..bc00225c87 100644 --- a/apps/multiplatform/.gitignore +++ b/apps/multiplatform/.gitignore @@ -16,7 +16,6 @@ android/build android/release common/build desktop/build -external/nanohttpd/build release # Generated SimpleX assets diff --git a/apps/multiplatform/README.md b/apps/multiplatform/README.md index 8fc0f701f3..158ebb7d02 100644 --- a/apps/multiplatform/README.md +++ b/apps/multiplatform/README.md @@ -6,15 +6,6 @@ This is a guide to contributing to the develop of the SimpleX android and deskto This is the **Kotlin Multiplatform (KMP)** mobile and desktop client for SimpleX Chat, sharing code between Android and Desktop (JVM) platforms using Compose Multiplatform for UI. -## Setup - -The desktop app builds nanohttpd from a submodule, Android does not use it. Before building -the desktop app on a fresh checkout: - -```bash -git submodule update --init --recursive -``` - ## Build Commands ```bash diff --git a/apps/multiplatform/common/build.gradle.kts b/apps/multiplatform/common/build.gradle.kts index a72ad2b0f1..06f2a19cb7 100644 --- a/apps/multiplatform/common/build.gradle.kts +++ b/apps/multiplatform/common/build.gradle.kts @@ -154,7 +154,6 @@ kotlin { implementation("org.slf4j:slf4j-simple:2.0.12") implementation("uk.co.caprica:vlcj:4.8.3") implementation("net.java.dev.jna:jna:5.14.0") - implementation(project(":external:nanohttpd")) implementation("com.squareup.okhttp3:okhttp:4.12.0") implementation("dev.onvoid.webrtc:webrtc-java:$webrtcJavaVersion") implementation("dev.onvoid.webrtc:webrtc-java:$webrtcJavaVersion:$webrtcJavaNativeClassifier") diff --git a/apps/multiplatform/external/nanohttpd/build.gradle.kts b/apps/multiplatform/external/nanohttpd/build.gradle.kts deleted file mode 100644 index 7841d8f803..0000000000 --- a/apps/multiplatform/external/nanohttpd/build.gradle.kts +++ /dev/null @@ -1,52 +0,0 @@ -plugins { - `java-library` -} - -// Built from the upstream submodule pinned at efb2ebf85a2b06f7c508aba9eaad5377e3a01e81, because -// upstream never released the org.nanohttpd packages and JitPack no longer serves or builds that -// commit. Only the core and websocket modules are used, the samples are not. -group = "org.nanohttpd" -version = "efb2ebf" - -val upstream = layout.projectDirectory.dir("upstream") - -sourceSets { - main { - java { - setSrcDirs(listOf(upstream.dir("core/src/main/java"), upstream.dir("websocket/src/main/java"))) - exclude("org/nanohttpd/samples/**") - } - resources.setSrcDirs(listOf(upstream.dir("core/src/main/resources"))) - } -} - -java { - val jvmVersion = JavaVersion.toVersion(providers.gradleProperty("kotlin.jvm.target").get()) - sourceCompatibility = jvmVersion - targetCompatibility = jvmVersion -} - -val upstreamSources = sourceSets.main.get().java.matching { include("org/nanohttpd/**") } - -// compileJava and jar silently succeed without the sources, so the check needs its own task. -// It cannot run during configuration, Android builds must work without the submodule. -val checkUpstreamSources by tasks.registering { - doFirst { - if (upstreamSources.isEmpty) { - throw GradleException("nanohttpd sources are missing, run: git submodule update --init --recursive") - } - } -} - -tasks.compileJava { - dependsOn(checkUpstreamSources) -} - -// Without this the jar records the build machine's timestamps, file order and file modes, -// which makes the desktop packages unreproducible -tasks.jar { - isPreserveFileTimestamps = false - isReproducibleFileOrder = true - filePermissions { unix("644") } - dirPermissions { unix("755") } -} diff --git a/apps/multiplatform/external/nanohttpd/upstream b/apps/multiplatform/external/nanohttpd/upstream deleted file mode 160000 index efb2ebf85a..0000000000 --- a/apps/multiplatform/external/nanohttpd/upstream +++ /dev/null @@ -1 +0,0 @@ -Subproject commit efb2ebf85a2b06f7c508aba9eaad5377e3a01e81 diff --git a/apps/multiplatform/settings.gradle.kts b/apps/multiplatform/settings.gradle.kts index 461ae54fc3..50a50d531d 100644 --- a/apps/multiplatform/settings.gradle.kts +++ b/apps/multiplatform/settings.gradle.kts @@ -18,4 +18,4 @@ pluginManagement { rootProject.name = "app" -include(":android", ":desktop", ":common", ":external:nanohttpd") +include(":android", ":desktop", ":common") diff --git a/scripts/simplex-chat-reproduce-builds.sh b/scripts/simplex-chat-reproduce-builds.sh index 5d18b226a8..d512735bf1 100755 --- a/scripts/simplex-chat-reproduce-builds.sh +++ b/scripts/simplex-chat-reproduce-builds.sh @@ -36,8 +36,7 @@ mkdir -p "${init_dir}/${TAG}-${repo_name}/from-source" "${init_dir}/${TAG}-${rep git -C "${tempdir}" clone "${repo}.git" &&\ cd "${tempdir}/${repo_name}" &&\ - git checkout "${TAG}" &&\ - git submodule update --init --recursive + git checkout "${TAG}" oses="22.04@sha256:5c8b2c0a6c745bc177669abfaa716b4bc57d58e2ea3882fb5da67f4d59e3dda5 24.04@sha256:98ff7968124952e719a8a69bb3cccdd217f5fe758108ac4f21ad22e1df44d237" @@ -148,9 +147,8 @@ for os_pair in ${oses}; do -t "${container_name}" \ sh -c 'rm -rf ./dist-newstyle ./apps/multiplatform' - # Also restore git to previous state + re-initialize submodules + # Also restore git to previous state git reset --hard && git clean -dfx - git submodule update --init --recursive # Stop containers, delete images docker stop "${container_name}"