Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
93 changes: 86 additions & 7 deletions .drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,33 @@ local build() = {
},
},
commands: [
"sdkmanager 'build-tools;35.0.0'",
"./gradlew clean test assemble"
"sdkmanager 'build-tools;37.0.0' 'platforms;android-37'",
"./gradlew clean testDebugUnitTest assemble"
]
},
{
name: "collect",
image: "debian:bookworm-slim",
commands: [
"mkdir -p artifact/screenshots",
"VERSION=$(grep versionName syncloud/build.gradle | head -1 | cut -d'\"' -f2)",
"for apk in syncloud/build/outputs/apk/release/*.apk; do cp $apk artifact/syncloud-$VERSION.apk; done",
"cp syncloud/build/outputs/roborazzi/*.png artifact/screenshots/ || true",
"cp -r syncloud/build/reports/tests artifact/test-report || true",
"ls -R artifact"
],
when: {
status: [ "failure", "success" ]
}
},
{
name: "publish to github",
image: "plugins/github-release:1.0.0",
settings: {
api_key: {
from_secret: "github_token"
},
files: "syncloud/build/outputs/apk/release/*",
files: "artifact/*.apk",
overwrite: true,
file_exists: "overwrite"
},
Expand All @@ -61,16 +76,80 @@ local build() = {
timeout: "2m",
command_timeout: "2m",
target: "/home/artifact/repo/android/${DRONE_BUILD_NUMBER}",
source: "syncloud/build/outputs/apk/release/*.apk",
strip_components: 5
source: "artifact/*",
strip_components: 1
},
when: {
status: [ "failure", "success" ]
}
}
]
],
trigger: {
event: [ "push", "tag" ]
}
};

local platform = "26.08.01";
local distro = "bookworm";

local probe() = {
kind: "pipeline",
type: "docker",
name: "probe",

platform: {
os: "linux",
arch: "amd64"
},
steps: [
{
name: "capabilities",
image: "debian:bookworm-slim",
privileged: true,
volumes: [ { name: "dev", path: "/dev" } ],
commands: [
"echo '--- kvm ---'",
"ls -l /dev/kvm || echo 'NO /dev/kvm'",
"echo '--- kernel modules for redroid ---'",
"grep -E 'binder|ashmem' /proc/modules || echo 'NO binder/ashmem modules'",
"echo '--- kernel ---'",
"uname -a",
"echo '--- cpu virt flags ---'",
"grep -o -m1 -E 'vmx|svm' /proc/cpuinfo || echo 'NO vmx/svm'",
"echo '--- network ---'",
"ip addr || (apt-get update -qq && apt-get install -y -qq iproute2 && ip addr)"
]
},
{
name: "mdns",
image: "python:3.12-slim-bookworm",
commands: [
"pip install --quiet zeroconf",
"python3 test/mdns_probe.py"
]
}
],
services: [
{
name: "device." + distro + ".com",
image: "syncloud/platform-" + distro + ":" + platform,
privileged: true,
volumes: [
{ name: "dbus", path: "/var/run/dbus" },
{ name: "dev", path: "/dev" }
]
}
],
volumes: [
{ name: "dbus", host: { path: "/var/run/dbus" } },
{ name: "dev", host: { path: "/dev" } }
],
trigger: {
event: [ "push" ]
}
};

[
build()
build(),
probe()
]
8 changes: 3 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.5.2'
classpath 'com.android.tools.build:gradle:9.3.2'
}
}
plugins {
id 'org.jetbrains.kotlin.jvm' version '2.0.10'
id 'org.jetbrains.kotlin.jvm' version '2.2.21'
id 'org.jetbrains.kotlin.plugin.compose' version '2.2.21' apply false
}
allprojects {
repositories {
google()
mavenCentral()
}
}
repositories {
mavenCentral()
}
21 changes: 0 additions & 21 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,23 +1,2 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Settings specified in this file will override any Gradle settings
# configured through the IDE.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xms1024m -Xmx4096m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Aug 11 21:18:02 BST 2024
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-9.7.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
82 changes: 53 additions & 29 deletions syncloud/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'org.jetbrains.kotlin.plugin.compose'

android {
namespace "org.syncloud.android"
compileSdk 37

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlin {
Expand All @@ -15,18 +19,15 @@ android {
}

defaultConfig {
compileSdk 33
minSdkVersion 23
targetSdkVersion 35
versionCode 24000
versionName "24.00"
multiDexEnabled true
targetSdkVersion 36
versionCode 26000
versionName "26.00"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

applicationVariants.configureEach { variant ->
variant.outputs.configureEach {
outputFileName = "syncloud-${variant.versionName}.apk"
}
buildFeatures {
compose true
}

signingConfigs {
Expand All @@ -49,31 +50,54 @@ android {
signingConfig signingConfigs.release
}
}
packagingOptions {

testOptions {
unitTests {
returnDefaultValues = true
includeAndroidResources = true
all {
it.systemProperty 'robolectric.graphicsMode', 'NATIVE'
it.systemProperty 'roborazzi.test.record', 'true'
it.testLogging {
events 'failed'
exceptionFormat 'full'
showStackTraces true
showCauses true
}
}
}
}

packaging {
resources {
excludes += ['META-INF/LICENSE', 'META-INF/LICENSE.txt', 'META-INF/NOTICE', 'META-INF/NOTICE.txt', 'log4j.properties', 'about.html', 'META-INF/beans.xml']
excludes += ['META-INF/LICENSE', 'META-INF/LICENSE.txt', 'META-INF/NOTICE', 'META-INF/NOTICE.txt', 'about.html', 'META-INF/beans.xml']
}
}
}


dependencies {
implementation 'log4j:log4j:1.2.17'
implementation 'ch.acra:acra-mail:5.11.3'
implementation 'ch.acra:acra-dialog:5.11.3'
implementation 'de.mindpipe.android:android-logging-log4j:1.0.3'
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.9.8'
implementation 'org.apache.commons:commons-lang3:3.3.2'
implementation 'com.google.guava:guava:27.0.1-android'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'com.lsjwzh:materialloadingprogressbar:0.5.8-RELEASE'
implementation "androidx.core:core-ktx:1.7.0"
implementation "com.squareup.okhttp3:okhttp:4.9.0"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3'
testImplementation 'junit:junit:4.10'
testImplementation "io.mockk:mockk:1.12.0"
implementation platform('androidx.compose:compose-bom:2026.08.00')
implementation 'androidx.compose.material3:material3'
implementation 'androidx.compose.ui:ui'
implementation 'androidx.activity:activity-compose:1.13.0'
implementation 'androidx.core:core-ktx:1.19.0'
implementation 'ch.acra:acra-mail:5.13.1'
implementation 'ch.acra:acra-dialog:5.13.1'
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.19.4'
implementation 'com.squareup.okhttp3:okhttp:5.5.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.11.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.11.0'
testImplementation platform('androidx.compose:compose-bom:2026.08.00')
testImplementation 'junit:junit:4.13.2'
testImplementation 'io.mockk:mockk:1.14.11'
testImplementation 'org.robolectric:robolectric:4.16.1'
testImplementation 'androidx.test:core:1.7.0'
testImplementation 'androidx.compose.ui:ui-test-junit4'
debugImplementation 'androidx.compose.ui:ui-test-manifest'
testImplementation 'io.github.takahirom.roborazzi:roborazzi:1.73.0'
testImplementation 'io.github.takahirom.roborazzi:roborazzi-compose:1.73.0'
testImplementation 'io.github.takahirom.roborazzi:roborazzi-junit-rule:1.73.0'
androidTestImplementation 'androidx.test.ext:junit:1.3.0'
androidTestImplementation 'androidx.test:runner:1.7.0'
}
2 changes: 0 additions & 2 deletions syncloud/proguard-android.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@

-keep class org.syncloud.** { *; }
-keep class org.eclipse.jetty.** { *; }
-keep class org.apache.log4j.** { *; }
-keep class org.fourthline.cling.** { *; }
-keep class org.seamless.** { *; }
-keep class com.google.common.base.** { *; }
Expand All @@ -88,7 +87,6 @@
-keep class com.jcraft.** { *; }
-keepnames class com.fasterxml.jackson.** { *; }

-dontwarn org.apache.log4j.**
-dontwarn org.fourthline.cling.**
-dontwarn org.seamless.**
-dontwarn com.google.common.base.**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package org.syncloud.android.discovery

import android.content.Context
import android.net.nsd.NsdManager
import android.net.wifi.WifiManager
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import kotlinx.coroutines.runBlocking
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
import java.util.Collections

const val DISCOVERY_SECONDS = 30

@RunWith(AndroidJUnit4::class)
class DiscoveryInstrumentedTest {

@Test
fun discoversSyncloudDeviceOnTheNetwork() = runBlocking {
val context = InstrumentationRegistry.getInstrumentation().targetContext
val manager = DiscoveryManager(
context.getSystemService(Context.WIFI_SERVICE) as WifiManager,
context.getSystemService(Context.NSD_SERVICE) as NsdManager
)

val devices = Collections.synchronizedList(mutableListOf<String>())
manager.run(DISCOVERY_SECONDS) { device -> devices.add(device) }

assertTrue(
"no device discovered over mdns in $DISCOVERY_SECONDS seconds",
devices.isNotEmpty()
)
}
}
12 changes: 1 addition & 11 deletions syncloud/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
android:name=".ui.AuthActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:exported="true"
android:theme="@style/NoActionBarTheme" >
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand All @@ -63,15 +62,6 @@
android:exported="true"
android:windowSoftInputMode="adjustResize|stateVisible" >
</activity>
<activity
android:name="org.acra.CrashReportDialog"
android:excludeFromRecents="true"
android:finishOnTaskLaunch="true"
android:launchMode="singleInstance"
android:exported="true"
android:theme="@style/DialogTheme" >
</activity>

</application>

</manifest>
17 changes: 0 additions & 17 deletions syncloud/src/main/java/org/syncloud/android/ConfigureLog4J.kt

This file was deleted.

Loading