diff --git a/android/source/build.gradle b/android/source/build.gradle index 772fe443aecf..1950b2357de5 100644 --- a/android/source/build.gradle +++ b/android/source/build.gradle @@ -1,9 +1,16 @@ +apply plugin: 'com.android.application' +// buildhost settings - paths and the like +apply from: 'liboSettings.gradle' + project.ext.set("archivesBaseName", "LibreOfficeViewer") allprojects { repositories { maven { url "https://maven.google.com" } + flatDir { + dirs "${liboWorkdir}/UnpackedTarball/owncloud_android_lib/build/outputs/aar" + } } } //build-time dependencies - android plugin for gradle @@ -16,10 +23,6 @@ buildscript { } } -apply plugin: 'com.android.application' -// buildhost settings - paths and the like -apply from: 'liboSettings.gradle' - // compile-time dependencies dependencies { compile fileTree(dir: "${liboInstdir}/${liboUREJavaFolder}", include: [ @@ -30,7 +33,8 @@ dependencies { "unoloader.jar" ]) compile files("${liboInstdir}/${liboShareJavaFolder}/unoil.jar") - compile files("${liboWorkdir}/UnpackedTarball/owncloud_android_lib/bin/owncloud-android-library.jar") + debugCompile(name:'owncloud_android_lib-debug', ext:'aar') + releaseCompile(name:'owncloud_android_lib-release', ext:'aar') compile 'com.android.support:design:26.1.0' // also pulls-in corresponding support libraries compile 'com.android.support.constraint:constraint-layout:1.0.2' } diff --git a/external/owncloud-android-lib/ExternalProject_owncloud_android_lib.mk b/external/owncloud-android-lib/ExternalProject_owncloud_android_lib.mk index 8dbd910d665c..a9d7591c1190 100644 --- a/external/owncloud-android-lib/ExternalProject_owncloud_android_lib.mk +++ b/external/owncloud-android-lib/ExternalProject_owncloud_android_lib.mk @@ -15,11 +15,7 @@ $(eval $(call gb_ExternalProject_register_targets,owncloud_android_lib,\ $(call gb_ExternalProject_get_state_target,owncloud_android_lib,build) : $(call gb_ExternalProject_run,build,\ - $(ICECREAM_RUN) "$(ANT)" \ - $(if $(verbose),-v,-q) \ - -f build.xml \ - -Dsdk.dir=$(ANDROID_SDK_HOME) -Dtarget=android-22 \ - release \ + ANDROID_HOME=$(ANDROID_SDK_HOME) $(SRCDIR)/android/source/gradlew assemble \ ) # vim: set noet sw=4 ts=4: diff --git a/external/owncloud-android-lib/UnpackedTarball_owncloud_android_lib.mk b/external/owncloud-android-lib/UnpackedTarball_owncloud_android_lib.mk index 0866f6f504e2..b9038cd1c961 100644 --- a/external/owncloud-android-lib/UnpackedTarball_owncloud_android_lib.mk +++ b/external/owncloud-android-lib/UnpackedTarball_owncloud_android_lib.mk @@ -11,4 +11,6 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,owncloud_android_lib)) $(eval $(call gb_UnpackedTarball_set_tarball,owncloud_android_lib,$(OWNCLOUD_ANDROID_LIB_TARBALL))) +$(eval $(call gb_UnpackedTarball_add_file,owncloud_android_lib,build.gradle,external/owncloud-android-lib/build.gradle)) + # vim: set noet sw=4 ts=4: diff --git a/external/owncloud-android-lib/build.gradle b/external/owncloud-android-lib/build.gradle new file mode 100644 index 000000000000..beb627fcc437 --- /dev/null +++ b/external/owncloud-android-lib/build.gradle @@ -0,0 +1,49 @@ +apply plugin: 'com.android.library' +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.3' + } +} + +android { + useLibrary 'org.apache.http.legacy' + + compileOptions { + encoding 'ISO8859-1' + sourceCompatibility JavaVersion.VERSION_1_7 + targetCompatibility JavaVersion.VERSION_1_7 + } + + compileSdkVersion 26 + buildToolsVersion "26.0.1" + + defaultConfig { + minSdkVersion 14 + targetSdkVersion 24 + } + + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + java { + srcDirs = [ + 'libs/commons-codec-1.9/src/main/java', + 'libs/commons-httpclient-3.1/src/java', + 'libs/jackrabbit-webdav-2.7.2/src/main/java', + 'libs/slf4j-1.7.12/src/java', + 'libs/tomcat-7.0.40/java', + 'src' + ] + } + resources { + srcDirs = [ + 'libs/tomcat-7.0.40/java', + 'libs/jackrabbit-webdav-2.7.2/src/main/java' + ] + } + } + } +}