From 6fe22ba1a564d0712856170226b28adea7f68e7d Mon Sep 17 00:00:00 2001 From: Daniel Weck Date: Mon, 17 Jun 2019 13:00:12 +0100 Subject: [PATCH] Using ReadiumSDK and ReadiumLCP AARs instead of Git readium-sdk and readium-lcp-client submodules --- .gitmodules | 6 -- SDKLauncher-Android/app/build.gradle | 18 +++- .../app/build_epubReadingSystem.gradle | 16 ++-- SDKLauncher-Android/app/build_stable.gradle | 82 +++++++++++-------- SDKLauncher-Android/readium-lcp/build.gradle | 2 + SDKLauncher-Android/readium-sdk/build.gradle | 2 + SDKLauncher-Android/settings.gradle | 14 ++-- readium-lcp-client | 1 - readium-sdk | 1 - 9 files changed, 83 insertions(+), 59 deletions(-) create mode 100644 SDKLauncher-Android/readium-lcp/build.gradle create mode 100644 SDKLauncher-Android/readium-sdk/build.gradle delete mode 160000 readium-lcp-client delete mode 160000 readium-sdk diff --git a/.gitmodules b/.gitmodules index c5fd212c..b907a9e2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,3 @@ -[submodule "readium-sdk"] - path = readium-sdk - url = https://github.com/readium/readium-sdk.git [submodule "readium-shared-js"] path = readium-shared-js url = https://github.com/readium/readium-shared-js.git -[submodule "readium-lcp-client"] - path = readium-lcp-client - url = https://github.com/readium/readium-lcp-client.git diff --git a/SDKLauncher-Android/app/build.gradle b/SDKLauncher-Android/app/build.gradle index 3ef81dec..20893302 100644 --- a/SDKLauncher-Android/app/build.gradle +++ b/SDKLauncher-Android/app/build.gradle @@ -33,6 +33,20 @@ dependencies { compile('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') { transitive = true; } + + api project(path: ':readium-sdk') + api project(path: ':readium-lcp') + +// api fileTree(dir: 'libs', include: ['readium-lcp.aar']) +// api fileTree(dir: 'libs', include: ['readium-sdk.aar']) + +// api files("libs/readium-sdk.aar") +// api files("libs/readium-lcp.aar") +// api files("readium-sdk.aar") +// api files("readium-lcp.aar") + +// compile(name:'readium-sdk', ext:'aar') +// compile(name:'readium-lcp', ext:'aar') } task buildCssAssets(type: Copy) { @@ -68,11 +82,11 @@ tasks.whenTaskAdded { task -> if (ndk_experimental) { task.dependsOn "buildAssets", - isDebug ? ":lcp:assembleDebug" : ":lcp:assembleRelease", + // isDebug ? ":lcp:assembleDebug" : ":lcp:assembleRelease", "buildEpubReadingSystem" } else { task.dependsOn "buildAssets", - isDebug ? ":lcp:assembleDebug" : ":lcp:assembleRelease", + // isDebug ? ":lcp:assembleDebug" : ":lcp:assembleRelease", "buildEpubReadingSystem" } } diff --git a/SDKLauncher-Android/app/build_epubReadingSystem.gradle b/SDKLauncher-Android/app/build_epubReadingSystem.gradle index ff0cc22b..cfde59b5 100644 --- a/SDKLauncher-Android/app/build_epubReadingSystem.gradle +++ b/SDKLauncher-Android/app/build_epubReadingSystem.gradle @@ -66,16 +66,16 @@ task buildEpubReadingSystem_Git() { ext.branchAndroid = { return rootBranch } // SDK - def sdkFolder = "$projectDir/../../readium-sdk/" - def sdkSha = getGitSha(sdkFolder) - def sdkStatus = getGitStatus(sdkFolder) - def sdkBranch = getGitBranch(sdkFolder, sdkSha) - def sdkTag = getGitTag(sdkFolder, sdkSha) +// def sdkFolder = "$projectDir/../../readium-sdk/" + def sdkSha = "N/A" // getGitSha(sdkFolder) + def sdkStatus = "N/A" // getGitStatus(sdkFolder) + def sdkBranch = "N/A" // getGitBranch(sdkFolder, sdkSha) + def sdkTag = "N/A" // getGitTag(sdkFolder, sdkSha) def sdkClean = "false"; - if (sdkStatus.length() == 0) { - sdkClean = "true"; - } +// if (sdkStatus.length() == 0) { +// sdkClean = "true"; +// } ext.shaSDK = { return sdkSha } ext.tagSDK = { return sdkTag } diff --git a/SDKLauncher-Android/app/build_stable.gradle b/SDKLauncher-Android/app/build_stable.gradle index b6af5177..a876e531 100644 --- a/SDKLauncher-Android/app/build_stable.gradle +++ b/SDKLauncher-Android/app/build_stable.gradle @@ -7,15 +7,22 @@ def ndk_skipARM = (rootProject.hasProperty("readium_ndk_skipARM") && rootProject def key_password = (rootProject.hasProperty("readium_sign_key_password") ? rootProject.readium_sign_key_password : "nope") def store_password = (rootProject.hasProperty("readium_sign_store_password") ? rootProject.readium_sign_store_password : "nope") -def lcpDir = project(':lcp').projectDir -def epub3Dir = project(':epub3').projectDir -def rsdkDir = project(':rsdk').projectDir +//def lcpDir = project(':lcp').projectDir +//def epub3Dir = project(':epub3').projectDir +//def rsdkDir = project(':rsdk').projectDir println "[[${project.name}]] (APP) Skip ARM: ${ndk_skipARM}" println "[[${project.name}]] (APP) Skip x86: ${ndk_skipX86}" def currentBuildType android { + packagingOptions { + pickFirst 'lib/armeabi-v7a/libgnustl_shared.so' + pickFirst 'lib/arm64-v8a/libgnustl_shared.so' + pickFirst 'lib/x86/libgnustl_shared.so' + pickFirst 'lib/x86_64/libgnustl_shared.so' + } + applicationVariants.all { variant -> println "[[${project.name}]] (APP) libraryVariant buildType: ${variant.buildType.name}" @@ -65,43 +72,48 @@ android { java { srcDirs = [ './src/main/java', - "${epub3Dir}/../lib/src/main/java", - "${lcpDir}/src/clientlib/java", - "${lcpDir}/src/contentfilter/java" +// "../../readium-sdk/Platform/Android/lib/src/main/java", +// "../../readium-lcp-client/platform/android/lib/src/clientlib/java", +// "../../readium-lcp-client/platform/android/lib/src/contentfilter/java" + // "${epub3Dir}/../lib/src/main/java", + // "${lcpDir}/src/clientlib/java", + // "${lcpDir}/src/contentfilter/java" ] } //java - jniLibs { - dependencies { - // project ":rsdk" - project ":lcp" - } - // srcDirs = [ - // "${epub3Dir}/jniLibs/RELEASE", - // "${lcpDir}/jniLibs/RELEASE", - // "${epub3Dir}/jniLibs/DEBUG", - // "${lcpDir}/jniLibs/DEBUG" - // ] - } //jniLibs +// jniLibs { +// dependencies { +// // project ":rsdk" +// // project ":lcp" +// project ":readium-sdk" +// project ":readium-lcp" +// } +// // srcDirs = [ +// // "${epub3Dir}/jniLibs/RELEASE", +// // "${lcpDir}/jniLibs/RELEASE", +// // "${epub3Dir}/jniLibs/DEBUG", +// // "${lcpDir}/jniLibs/DEBUG" +// // ] +// } //jniLibs } //main } //sourceSets buildTypes { debug { - sourceSets.main.jniLibs.srcDirs = [ - // "${epub3Dir}/jniLibs/DEBUG", - "${lcpDir}/jniLibs/DEBUG" - ] + // sourceSets.main.jniLibs.srcDirs = [ + // // "${epub3Dir}/jniLibs/DEBUG", + // "${lcpDir}/jniLibs/DEBUG" + // ] ext.enableCrashlytics = false minifyEnabled = false } release { - sourceSets.main.jniLibs.srcDirs = [ - // "${epub3Dir}/jniLibs/RELEASE", - "${lcpDir}/jniLibs/RELEASE" - ] + // sourceSets.main.jniLibs.srcDirs = [ + // // "${epub3Dir}/jniLibs/RELEASE", + // "${lcpDir}/jniLibs/RELEASE" + // ] ext.enableCrashlytics = false @@ -120,25 +132,25 @@ android { if (!ndk_skipARM && !ndk_skipX86) { 'armeabi-v7a--arm64-v8a--x86--x86_64' { dimension "version" - ndk.with { - abiFilters = ['armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'] - } + // ndk.with { + // abiFilters = ['armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'] + // } } } else { if (!ndk_skipARM) { 'armeabi-v7a--arm64-v8a' { dimension "version" - ndk.with { - abiFilters = ['armeabi-v7a', 'arm64-v8a'] - } + // ndk.with { + // abiFilters = ['armeabi-v7a', 'arm64-v8a'] + // } } } if (!ndk_skipX86) { 'x86--x86_64' { dimension "version" - ndk.with { - abiFilters = ['x86', 'x86_64'] - } + // ndk.with { + // abiFilters = ['x86', 'x86_64'] + // } } } } diff --git a/SDKLauncher-Android/readium-lcp/build.gradle b/SDKLauncher-Android/readium-lcp/build.gradle new file mode 100644 index 00000000..1f004222 --- /dev/null +++ b/SDKLauncher-Android/readium-lcp/build.gradle @@ -0,0 +1,2 @@ +configurations.maybeCreate("default") +artifacts.add("default", file('readium-lcp.aar')) \ No newline at end of file diff --git a/SDKLauncher-Android/readium-sdk/build.gradle b/SDKLauncher-Android/readium-sdk/build.gradle new file mode 100644 index 00000000..5880e53d --- /dev/null +++ b/SDKLauncher-Android/readium-sdk/build.gradle @@ -0,0 +1,2 @@ +configurations.maybeCreate("default") +artifacts.add("default", file('readium-sdk.aar')) \ No newline at end of file diff --git a/SDKLauncher-Android/settings.gradle b/SDKLauncher-Android/settings.gradle index e81f3f4c..92943fd4 100644 --- a/SDKLauncher-Android/settings.gradle +++ b/SDKLauncher-Android/settings.gradle @@ -1,11 +1,13 @@ -include ':epub3' -include ':rsdk' +// include ':epub3' +// include ':rsdk' -include ':lcp' +// include ':lcp' include ':app' +include ':readium-sdk' +include ':readium-lcp' -project(':epub3').projectDir = new File(rootProject.projectDir, '../readium-sdk/Platform/Android/epub3') -project(':rsdk').projectDir = new File(rootProject.projectDir, '../readium-sdk/Platform/Android/lib') +// project(':epub3').projectDir = new File(rootProject.projectDir, '../readium-sdk/Platform/Android/epub3') +// project(':rsdk').projectDir = new File(rootProject.projectDir, '../readium-sdk/Platform/Android/lib') -project(':lcp').projectDir = new File(rootProject.projectDir, '../readium-lcp-client/platform/android/lib') +// project(':lcp').projectDir = new File(rootProject.projectDir, '../readium-lcp-client/platform/android/lib') diff --git a/readium-lcp-client b/readium-lcp-client deleted file mode 160000 index 0277d71d..00000000 --- a/readium-lcp-client +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0277d71d9c44d006a45fb463bdc45902e6ab30a2 diff --git a/readium-sdk b/readium-sdk deleted file mode 160000 index 41c079db..00000000 --- a/readium-sdk +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 41c079dbcf3c41c71c4a8eaf1e8199f924ffaaa2