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

Fix build due to JCenter shutdown (fixes #1135) #1136

Merged
merged 51 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
0882228
Update build.gradle
Catfriend1 Sep 20, 2024
abcd027
11
Catfriend1 Sep 20, 2024
c7614ce
Update build.gradle.kts
Catfriend1 Sep 20, 2024
0f17de5
Create settings.gradle.kts
Catfriend1 Sep 20, 2024
38a9caa
Update gradle.properties
Catfriend1 Sep 20, 2024
74f75bc
Revert "Update gradle.properties"
Catfriend1 Sep 20, 2024
a2c8cad
Update build.gradle
Catfriend1 Sep 20, 2024
d3cbf72
Revert "Revert "Update gradle.properties""
Catfriend1 Sep 20, 2024
a049ed8
Update DrawerFragment.java
Catfriend1 Sep 20, 2024
f1b8ec4
Update build.gradle.kts
Catfriend1 Sep 20, 2024
42ec386
Update build.gradle.kts
Catfriend1 Sep 20, 2024
5bc64ce
Update build.gradle.kts
Catfriend1 Sep 20, 2024
76a0f87
Update build.gradle.kts
Catfriend1 Sep 20, 2024
ab231ef
Update build.gradle.kts
Catfriend1 Sep 20, 2024
53a6e8c
Update build.gradle.kts
Catfriend1 Sep 20, 2024
d69c48e
Update build.gradle.kts
Catfriend1 Sep 20, 2024
f7b8754
Update build.gradle.kts
Catfriend1 Sep 20, 2024
a8a7032
Update build.gradle.kts
Catfriend1 Sep 20, 2024
a5f5e78
Update build.gradle.kts
Catfriend1 Sep 20, 2024
d8ac2eb
Update build.gradle.kts
Catfriend1 Sep 20, 2024
30aa364
Update build.gradle.kts
Catfriend1 Sep 20, 2024
14978e0
Update build.gradle.kts
Catfriend1 Sep 20, 2024
ccd7cab
Update build.gradle.kts
Catfriend1 Sep 20, 2024
c2df517
Update build.gradle.kts
Catfriend1 Sep 20, 2024
8129467
Update build.gradle.kts
Catfriend1 Sep 20, 2024
9cf6db8
1
Catfriend1 Sep 20, 2024
c50aada
Update build.gradle.kts
Catfriend1 Sep 20, 2024
a5e7bb0
Update build.gradle.kts
Catfriend1 Sep 20, 2024
45c6ad3
Update build.gradle.kts
Catfriend1 Sep 20, 2024
019647a
TODO
Catfriend1 Sep 20, 2024
4e71e5a
Merge branch 'main' into fixFdroidBuild
Catfriend1 Oct 21, 2024
8395f3a
Update build.gradle.kts
Catfriend1 Oct 21, 2024
7694c61
Update build.gradle.kts
Catfriend1 Oct 21, 2024
d7220a5
1
Catfriend1 Oct 21, 2024
5830541
Update build.gradle.kts
Catfriend1 Oct 21, 2024
8967ab4
Update build.gradle.kts
Catfriend1 Oct 21, 2024
4bbb523
Update build.gradle.kts
Catfriend1 Oct 21, 2024
1f51008
Update build-syncthing.py
Catfriend1 Oct 21, 2024
63afaa0
Update build-syncthing.py
Catfriend1 Oct 21, 2024
686e074
Update build-syncthing.py
Catfriend1 Oct 21, 2024
5fe821c
Update versions.gradle.kts
Catfriend1 Oct 21, 2024
dda8484
Update build.gradle.kts
Catfriend1 Oct 21, 2024
b2462a5
Delete versions.gradle.kts
Catfriend1 Oct 21, 2024
0de7dc8
Update build.gradle.kts
Catfriend1 Oct 21, 2024
d406a11
Update build.gradle.kts
Catfriend1 Oct 21, 2024
f6780b2
Update build.gradle.kts
Catfriend1 Oct 21, 2024
881c02b
Update SyncthingNative_update_and_build.cmd
Catfriend1 Oct 21, 2024
fe5fb9f
Update syncthing
Catfriend1 Oct 21, 2024
57bec07
Update build.gradle.kts
Catfriend1 Oct 21, 2024
80243ed
Update App_build_and_release.cmd
Catfriend1 Oct 21, 2024
2d49dfa
Update postbuild_copy_apk.cmd
Catfriend1 Oct 21, 2024
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
2 changes: 1 addition & 1 deletion App_build_and_release.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cls
REM
REM Script Consts.
SET CLEANUP_BEFORE_BUILD=1
SET SKIP_RELEASE_BUILD=0
SET SKIP_RELEASE_BUILD=1
REM
REM Runtime Variables.
IF EXIST "%LocalAppData%\Android\Sdk" SET "ANDROID_SDK_ROOT=%LocalAppData%\Android\Sdk"
Expand Down
8 changes: 4 additions & 4 deletions SyncthingNative_update_and_build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ git fetch --quiet --all
SET RESULT=%ERRORLEVEL%
IF NOT "%RESULT%" == "0" echo [ERROR] git fetch FAILED. & goto :eos
REM
echo [INFO] Reading required SyncthingNative from versions.gradle ...
echo [INFO] Reading required SyncthingNative from build.gradle.kts ...
IF NOT DEFINED SYNCTHING_NATIVE_REQUIRED_VERSION call :getRequiredSynchtingNativeVersion
REM
echo [INFO] Checking out syncthing_%SYNCTHING_NATIVE_REQUIRED_VERSION% ...
Expand Down Expand Up @@ -103,17 +103,17 @@ goto :eof
REM
REM Get "versionMajor"
SET VERSION_MAJOR=
FOR /F "tokens=2 delims== " %%A IN ('type "%SCRIPT_PATH%app\versions.gradle" 2^>^&1 ^| findstr "versionMajor"') DO SET VERSION_MAJOR=%%A
FOR /F "tokens=2 delims==) " %%A IN ('type "%SCRIPT_PATH%build.gradle.kts" 2^>^&1 ^| findstr "versionMajor"') DO SET VERSION_MAJOR=%%A
SET VERSION_MAJOR=%VERSION_MAJOR:"=%
REM
REM Get "versionMinor"
SET VERSION_MINOR=
FOR /F "tokens=2 delims== " %%A IN ('type "%SCRIPT_PATH%app\versions.gradle" 2^>^&1 ^| findstr "versionMinor"') DO SET VERSION_MINOR=%%A
FOR /F "tokens=2 delims==) " %%A IN ('type "%SCRIPT_PATH%build.gradle.kts" 2^>^&1 ^| findstr "versionMinor"') DO SET VERSION_MINOR=%%A
SET VERSION_MINOR=%VERSION_MINOR:"=%
REM
REM Get "versionPatch"
SET VERSION_PATCH=
FOR /F "tokens=2 delims== " %%A IN ('type "%SCRIPT_PATH%app\versions.gradle" 2^>^&1 ^| findstr "versionPatch"') DO SET VERSION_PATCH=%%A
FOR /F "tokens=2 delims==) " %%A IN ('type "%SCRIPT_PATH%build.gradle.kts" 2^>^&1 ^| findstr "versionPatch"') DO SET VERSION_PATCH=%%A
SET VERSION_PATCH=%VERSION_PATCH:"=%
REM
SET "SYNCTHING_NATIVE_REQUIRED_VERSION=v%VERSION_MAJOR%.%VERSION_MINOR%.%VERSION_PATCH%"
Expand Down
152 changes: 0 additions & 152 deletions app/build.gradle

This file was deleted.

148 changes: 148 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
plugins {
id("com.android.application")
id("com.github.ben-manes.versions")
id("com.github.triplet.play") version "3.7.0"
}

dependencies {
androidTestImplementation("androidx.annotation:annotation:1.2.0")
androidTestImplementation("androidx.test:rules:1.4.0")
annotationProcessor("com.google.dagger:dagger-compiler:2.38.1")
implementation("androidx.preference:preference:1.1.1")
implementation("androidx.constraintlayout:constraintlayout:2.0.4")
implementation("androidx.core:core:1.3.0")
implementation("androidx.documentfile:documentfile:1.0.1")
implementation("androidx.fragment:fragment:1.2.5")
implementation("androidx.localbroadcastmanager:localbroadcastmanager:1.0.0")
implementation("androidx.recyclerview:recyclerview:1.1.0")
implementation("com.android.volley:volley:1.2.1")
implementation("com.annimon:stream:1.2.2")
implementation("com.google.android.material:material:1.4.0")
implementation("com.google.code.gson:gson:2.8.8")
implementation("com.google.dagger:dagger:2.38.1")
implementation("com.google.guava:guava:30.1.1-android")
// Do not upgrade zxing:core beyond 3.3.0 to ensure Android 6.0 compatibility, see issue #761.
implementation("com.google.zxing:core:3.3.0")
implementation("com.journeyapps:zxing-android-embedded:4.2.0") { isTransitive = false }
implementation("eu.chainfire:libsuperuser:1.1.1")
implementation("org.mindrot:jbcrypt:0.4")

constraints {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
}
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") {
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
}
}
}

android {
val ndkVersionShared = rootProject.extra.get("ndkVersionShared")
val versionMajor: kotlin.Int by rootProject.extra
val versionMinor: kotlin.Int by rootProject.extra
val versionPatch: kotlin.Int by rootProject.extra
val versionWrapper: kotlin.Int by rootProject.extra

compileSdk = 35
buildToolsVersion = "35.0.0"
ndkVersion = "${ndkVersionShared}"

namespace = "com.nutomic.syncthingandroid"
buildFeatures.dataBinding = true

defaultConfig {
applicationId = "com.github.catfriend1.syncthingandroid"
minSdk = 21
targetSdk = 35
versionCode = versionMajor * 1000000 + versionMinor * 10000 + versionPatch * 100 + versionWrapper
versionName = "${versionMajor}.${versionMinor}.${versionPatch}.${versionWrapper}"
testApplicationId = "com.github.catfriend1.syncthingandroid.test"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

signingConfigs {
create("release") {
storeFile = System.getenv("SYNCTHING_RELEASE_STORE_FILE")?.let(::file)
storePassword = System.getenv("SIGNING_PASSWORD")
keyAlias = System.getenv("SYNCTHING_RELEASE_KEY_ALIAS")
keyPassword = System.getenv("SIGNING_PASSWORD")
}
}

buildTypes {
getByName("debug") {
applicationIdSuffix = ".debug"
isDebuggable = true
isJniDebuggable = true
isMinifyEnabled = false
}
getByName("release") {
signingConfig = signingConfigs.runCatching { getByName("release") }
.getOrNull()
.takeIf { it?.storeFile != null }
}
}

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

bundle {
language {
enableSplit = false
}
density {
enableSplit = true
}
abi {
enableSplit = true
}
}


packaging {
jniLibs {
useLegacyPackaging = true
}
}
lint {
abortOnError = true
disable += "UnsafeExperimentalUsageError"
disable += "UnsafeExperimentalUsageWarning"
disable += "ExpiringTargetSdkVersion"
disable += "ExpiredTargetSdkVersion"
}
}

play {
// Use ANDROID_PUBLISHER_CREDENTIALS environment variable to specify serviceAccountCredentials.
track = "beta"
resolutionStrategy = com.github.triplet.gradle.androidpublisher.ResolutionStrategy.IGNORE
defaultToAppBundles = true
}

/**
* Some languages are not supported by Google Play, so we ignore them.
*/
tasks.register<Delete>("deleteUnsupportedPlayTranslations") {
delete(
"src/main/play/listings/el-EL/",
"src/main/play/listings/en/",
"src/main/play/listings/eu/",
"src/main/play/listings/nb/",
"src/main/play/listings/nl_BE/",
"src/main/play/listings/nl-BE/",
"src/main/play/listings/nn/",
"src/main/play/listings/ta/",
)
}

task<Exec>("postBuildScript") {
commandLine("python", "-u" , "./postbuild.py")
}

project.afterEvaluate {
project.getTasks().getByName("mergeDebugJniLibFolders").dependsOn(":syncthing:buildNative")
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.google.zxing.BarcodeFormat;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.WriterException;
import com.nutomic.syncthingandroid.BuildConfig;
import com.nutomic.syncthingandroid.R;
import com.nutomic.syncthingandroid.activities.MainActivity;
import com.nutomic.syncthingandroid.activities.RecentChangesActivity;
Expand Down Expand Up @@ -135,7 +134,7 @@ private void updateUI() {
* Reason: SyncthingNative's Web UI is not approved by Google because
* it is lacking full DPAD navigation support. See issue #567.
*/
mDrawerActionWebGui.setVisibility((!mRunningOnTV || BuildConfig.DEBUG) ? View.VISIBLE : View.GONE);
mDrawerActionWebGui.setVisibility((!mRunningOnTV) ? View.VISIBLE : View.GONE);

// Enable buttons if syncthing is running.
mDrawerRecentChanges.setEnabled(syncthingRunning);
Expand Down
6 changes: 0 additions & 6 deletions app/versions.gradle

This file was deleted.

30 changes: 0 additions & 30 deletions build.gradle

This file was deleted.

Loading