Skip to content

Commit

Permalink
Merge pull request #83 from gilbsgilbs/rework-rclone-build
Browse files Browse the repository at this point in the history
Rework rclone build script
  • Loading branch information
newhinton authored Apr 26, 2023
2 parents 98e2b3f + 5016108 commit b849674
Show file tree
Hide file tree
Showing 9 changed files with 205 additions and 190 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ jobs:
with:
go-version: 1.20
id: go
- name: Force NDK version
run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;25.0.8775105"
- name: Build rclone
run: ./gradlew rclone:buildAll
- name: Install NDK
run: |
NDK_VERSION="$(grep -E "^de\.felixnuesse\.extract\.ndkVersion=" gradle.properties | cut -d'=' -f2)"
yes | sudo "${ANDROID_HOME}/tools/bin/sdkmanager" --licenses
sudo "${ANDROID_HOME}/tools/bin/sdkmanager" "ndk;${NDK_VERSION}"
- name: Build app
run: ./gradlew assembleOssDebug
- name: Upload APK (arm)
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ freeline_project_description.json
# Don't version native libraries or IDE artifacts. Module config should be done in gradle.
# Generated artifacts (apks, libraries) just slow down cloning and can be recreated from source
# anyways.
app/lib/
release/

.idea/encodings.xml
Expand Down
36 changes: 12 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,23 @@ Usage

Developing
------------
[See the developer-documentation](https://x0b.github.io/dev/).

Build rclone manually run:
You should first make sure you have:

```
./gradlew rclone:buildAll
```
- Go 1.20+ installed and in your PATH
- Java installed and in your PATH
- Android SDK command-line tools installed OR the NDK version specified in `gradle.properties`
installed

When building rclone with a go version that is too old (eg 1.15.5), this error may show up:
You can then build the app normally from Android Studio or from CLI by running:

```
ld.lld: error: duplicate symbol: x_cgo_inittls
```
```sh
# Debug build
./gradlew assembleOssDebug

It can be fixed by using a more recent version of go.
# or release build
./gradlew assembleOssRelease
```

Known Issues
------------
Expand All @@ -98,20 +100,6 @@ Contributing
See [CONTRIBUTING](./CONTRIBUTING.md)


Building
------------
```
// choose the appropriate version for your device
cd rclone
../gradlew rclone:buildNative // For all devices
../gradlew rclone:buildArm64
../gradlew rclone:buildArm
../gradlew rclone:buildx86
../gradlew rclone:buildx64
```



License
-----------------
### About this app
Expand Down
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/build
/lib
18 changes: 13 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@ import java.text.SimpleDateFormat
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

tasks.whenTaskAdded { task ->
// Build rclone beforehand.
if (task.name.startsWith('compile')) {
task.dependsOn(':rclone:buildAll')
}
}

android {
signingConfigs {
github_x0b {
keyAlias 'github_x0b'
}
}
compileSdkVersion 33
ndkVersion '25.0.8775105'
ndkVersion project.properties['de.felixnuesse.extract.ndkVersion']
defaultConfig {
applicationId 'de.felixnuesse.extract'
minSdkVersion 23
Expand Down Expand Up @@ -67,10 +74,11 @@ android {
}

project.ext.versionCodes = [
'armeabi-v7a': 6,
'arm64-v8a' : 7,
'x86' : 8,
'x86_64' : 9]
'armeabi-v7a': 6,
'arm64-v8a' : 7,
'x86' : 8,
'x86_64' : 9
]

android.applicationVariants.all { variant ->
variant.outputs.each { output ->
Expand Down
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

ext.kotlinVersion = '1.7.20'
repositories {
google()
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M"
android.enableJetifier=false
android.useAndroidX=true
de.felixnuesse.extract.rCloneVersion=1.61.1
de.felixnuesse.extract.ndkVersion=25.0.8775105
de.felixnuesse.extract.ndkToolchainVersion=33
2 changes: 1 addition & 1 deletion rclone/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/gopath
/cache
Loading

0 comments on commit b849674

Please sign in to comment.