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

As flamingo compat #107

Merged
merged 5 commits into from
Jul 3, 2023
Merged
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
6 changes: 3 additions & 3 deletions .github/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM fabernovel/android:api-29-v1.1.0
FROM openjdk:17-oracle

# Install packages
RUN apt-get update && apt-get install -y sudo file curl
Expand All @@ -12,8 +12,8 @@ RUN curl -L --keepalive --output jq.deb http://security.ubuntu.com/ubuntu/pool/u
&& apt install ./jq.deb

# Install Android Studio
RUN curl -C - -L --progress-bar --output android-studio.tar.gz https://storage.googleapis.com/android-studio-distributions/android-studio-2022.1.1.20-linux.tar.gz \
RUN curl -C - -L --progress-bar --output android-studio.tar.gz https://storage.googleapis.com/android-studio-distributions/android-studio-2022.2.1.20-linux.tar.gz \
&& tar -xvf android-studio.tar.gz -C opt \
&& rm android-studio.tar.gz

ENV ANDROID_STUDIO_PATH /opt/android-studio
ENV ANDROID_STUDIO_PATH /opt/android-studio
8 changes: 4 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
server_tests:
name: Run server lib tests
runs-on: ubuntu-latest
container: fabernovel/android:api-29-v1.1.0
container: openjdk:17-oracle
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -90,7 +90,7 @@ jobs:
gradle_tests:
name: Run gradle plugin tests
runs-on: ubuntu-latest
container: jeppeman/globallydynamic-studio:as-2020.3.1.22
container: jeppeman/globallydynamic-studio:as-2022.2.1.20
env:
ANDROID_SDK_ROOT: /opt/android/sdk
JAVA_HOME: /opt/android-studio/jre
Expand All @@ -109,7 +109,7 @@ jobs:
build_studio_plugin:
name: Build studio plugin
runs-on: ubuntu-latest
container: jeppeman/globallydynamic-studio:as-2022.1.1.20
container: jeppeman/globallydynamic-studio:as-2022.2.1.20
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -125,7 +125,7 @@ jobs:
studio_tests:
name: Run studio plugin tests
runs-on: ubuntu-latest
container: jeppeman/globallydynamic-studio:as-2022.1.1.20
container: jeppeman/globallydynamic-studio:as-2022.2.1.20
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions globallydynamic-android-lib/deps.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ def versions = [
kotlin : '1.6.21',
appcompat : '1.4.2',
coroutines : '1.6.2',
androidplugin : '7.2.1',
androidplugin : '7.4.1',
lifecycle : '2.4.1',
lifecycle_extensions : '2.2.0',
mockito : '3.3.3',
Expand All @@ -25,7 +25,7 @@ def versions = [
play : '1.10.3',
dynamicability : '1.0.17.300',
autoservice : '1.0-rc6',
globallydynamic_gradle: '1.5.0',
globallydynamic_gradle: '1.6.0',
uiautomator : '2.2.0',
javadoc : '0.3.0'
]
Expand Down
6 changes: 3 additions & 3 deletions globallydynamic-android-lib/gradle/gradle-mvn-push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ afterEvaluate { project ->
project.getPlugins().hasPlugin('com.android.library')) {

task androidSourcesJar(type: Jar) {
classifier = 'sources'
archiveClassifier = 'sources'
from android.sourceSets.main.java.source
}

Expand Down Expand Up @@ -151,12 +151,12 @@ afterEvaluate { project ->
apply plugin: 'maven-publish'

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
archiveClassifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
4 changes: 2 additions & 2 deletions globallydynamic-android-lib/minimal-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.2.1"
classpath "com.jeppeman.globallydynamic.gradle:plugin:1.5.0"
classpath "com.android.tools.build:gradle:7.4.1"
classpath "com.jeppeman.globallydynamic.gradle:plugin:1.6.0"
}
}

Expand Down
8 changes: 4 additions & 4 deletions globallydynamic-server-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ buildscript {
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.10.1"
classpath "gradle.plugin.de.fuerstenau:BuildConfigPlugin:1.1.8"
classpath "com.github.gmazzo.buildconfig:com.github.gmazzo.buildconfig.gradle.plugin:3.0.3"
classpath "com.github.ben-manes:gradle-versions-plugin:$versions.versionsplugin"
classpath "com.github.jengelman.gradle.plugins:shadow:$versions.shadowjar"
}
}

ext {
sourceCompatibilityVersion = JavaVersion.VERSION_1_8
targetCompatibilityVersion = JavaVersion.VERSION_1_8
jvmTargetVersion = "1.8"
sourceCompatibilityVersion = JavaVersion.VERSION_17
targetCompatibilityVersion = JavaVersion.VERSION_17
jvmTargetVersion = "17"
}

subprojects {
Expand Down
18 changes: 7 additions & 11 deletions globallydynamic-server-lib/deps.gradle
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
import java.nio.file.Paths

def versions = [
kotlin : '1.5.21',
kotlin : '1.8.21',
jetty : '9.4.27.v20200227',
versionsplugin: '0.25.0',
shadowjar : '4.0.4',
guava : '28.1-jre',
bundletool : '1.10.0',
guava : '30.1-jre',
bundletool : '1.11.2',
gson : '2.8.6',
junit : '5.5.2',
junit_platform: '1.5.2',
truth : '1.1.0',
mockito : '2.23.4',
mockito_kotlin: '2.1.0',
mockito : '5.4.0',
mockito_kotlin: '5.0.0',
httpcomponents: '4.5.10',
gcp_storage : '1.103.0',
gcp_storage : '2.23.0',
s3_storage : '1.11.822'
]

ext.versions = versions

def deps = [:]

deps.kotlin = [
stdlib: "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$versions.kotlin"
]

deps.jetty = [
server: "org.eclipse.jetty:jetty-server:$versions.jetty"
]
Expand All @@ -44,7 +40,7 @@ deps.junit = [
deps.mockito = [
core : "org.mockito:mockito-core:$versions.mockito",
jupiter: "org.mockito:mockito-junit-jupiter:$versions.mockito",
kotlin : "com.nhaarman.mockitokotlin2:mockito-kotlin:$versions.mockito_kotlin"
kotlin : "org.mockito.kotlin:mockito-kotlin:$versions.mockito_kotlin"
]

deps.truth = "androidx.test.ext:truth:$versions.truth"
Expand Down
2 changes: 1 addition & 1 deletion globallydynamic-server-lib/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GROUP=com.jeppeman.globallydynamic.server
VERSION_NAME=1.3.0-SNAPSHOT
VERSION_NAME=1.4.0-SNAPSHOT

POM_DESCRIPTION=GloballyDynamic Server - an http server that facilitates dynamic delivery without Google Play for Android.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
22 changes: 11 additions & 11 deletions globallydynamic-server-lib/integration-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ test {
}

dependencies {
testCompile project(':server')
testCompile deps.junit.api
testCompile deps.junit.params
testCompile deps.junit.engine
testCompile deps.junit.runner
testCompile deps.mockito.core
testCompile deps.mockito.jupiter
testCompile deps.mockito.kotlin
testCompile deps.truth
testCompile deps.httpcomponents.client
testCompile deps.httpcomponents.mime
testImplementation project(':server')
testImplementation deps.junit.api
testImplementation deps.junit.params
testImplementation deps.junit.engine
testImplementation deps.junit.runner
testImplementation deps.mockito.core
testImplementation deps.mockito.jupiter
testImplementation deps.mockito.kotlin
testImplementation deps.truth
testImplementation deps.httpcomponents.client
testImplementation deps.httpcomponents.mime
}
44 changes: 23 additions & 21 deletions globallydynamic-server-lib/server/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'org.jetbrains.dokka'
apply plugin: "de.fuerstenau.buildconfig"
apply plugin: "com.github.gmazzo.buildconfig"
apply plugin: 'idea'

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
Expand All @@ -17,14 +16,18 @@ task executableJar(type: ShadowJar) {
destinationDir = file(project.property("outputDir"))
}
from sourceSets.main.output
configurations = [
project.configurations.compile
]
configurations = [project.configurations.runtimeClasspath]
manifest {
attributes 'Main-Class': 'com.jeppeman.globallydynamic.server.GloballyDynamicMainKt'
}
}

task runExecutableJar(type: JavaExec) {
dependsOn executableJar
classpath = files("$buildDir/libs/globallydynamic-server-$VERSION_NAME-standalone.jar")
mainClass = "com.jeppeman.globallydynamic.server.GloballyDynamicMainKt"
}

test {
useJUnitPlatform()
}
Expand All @@ -34,7 +37,7 @@ configurations {
}

buildConfig {
buildConfigField 'String', 'VERSION', "${VERSION_NAME}"
buildConfigField 'String', 'VERSION', "\"${VERSION_NAME}\""
}

dokka {
Expand All @@ -45,24 +48,23 @@ dokka {
}

dependencies {
compile deps.kotlin.stdlib
compile deps.jetty.server
compile deps.guava
compile deps.gcp.storage
compile deps.aws.s3
compile deps.bundletool
implementation deps.jetty.server
implementation deps.gcp.storage
implementation deps.aws.s3
implementation deps.bundletool
jarLibs deps.bundletool

// compileOnly deps.bundletool_maven
/* compileOnly deps.bundletool_maven
compileOnly deps.guava*/

testCompile deps.junit.api
testCompile deps.junit.params
testCompile deps.junit.engine
testCompile deps.junit.runner
testCompile deps.mockito.core
testCompile deps.mockito.jupiter
testCompile deps.mockito.kotlin
testCompile deps.truth
testImplementation deps.junit.api
testImplementation deps.junit.params
testImplementation deps.junit.engine
testImplementation deps.junit.runner
testImplementation deps.mockito.core
testImplementation deps.mockito.jupiter
testImplementation deps.mockito.kotlin
testImplementation deps.truth
}

jar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.android.tools.build.bundletool.commands.ExtractApksCommand
import com.android.tools.build.bundletool.model.Password
import com.android.tools.build.bundletool.model.SigningConfiguration
import com.android.tools.build.bundletool.model.exceptions.CommandExecutionException
import com.google.common.collect.ImmutableList
import com.google.common.collect.ImmutableSet
import com.google.gson.Gson
import com.google.gson.JsonObject
Expand Down Expand Up @@ -101,7 +102,7 @@ internal class BundleManagerImpl(
outputDirectory: Path,
deviceSpec: Devices.DeviceSpec,
features: Array<String>
): List<Path> = ExtractApksCommand.builder()
): ImmutableList<Path> = ExtractApksCommand.builder()
.setApksArchivePath(apksArchivePath)
.setOutputDirectory(outputDirectory)
.setDeviceSpec(deviceSpec)
Expand Down Expand Up @@ -231,9 +232,9 @@ internal class BundleManagerImpl(
keyPass = keyPass,
keyAlias = keyAlias
)
} catch (commandExecutionException: CommandExecutionException) {
} catch (exception: Exception) {
return BundleManager.Result.Error.BuildApksFailure(
commandExecutionException.message ?: commandExecutionException.stackTraceToString())
exception.message ?: exception.stackTraceToString())
}

val apkSetFileName = getFinalFileName(applicationId, version, variant, "apks")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ internal class DownloadSplitsPathHandler(
"got ${versionParam.joinToString(",")}")
}

val includeMissing = includeMissingParam?.first()?.toBoolean() ?: false

if (featuresToInstallParam.isEmpty() && languagesToInstallParam.isEmpty()) {
throw HttpException(HttpStatus.BAD_REQUEST_400, "No features or languages included in the request")
}
Expand All @@ -93,9 +91,12 @@ internal class DownloadSplitsPathHandler(
when (val validationResult = bundleManager.validateSignature(signature, applicationId, version, variant)) {
is BundleManager.Result.Error ->
throw HttpException(HttpStatus.BAD_REQUEST_400, validationResult.message)
else -> Unit
}
}

val includeMissing = includeMissingParam?.first()?.toBoolean() ?: false

val compressedSplitsResult = bundleManager.generateCompressedSplits(
applicationId = applicationIdParam.first(),
version = version,
Expand Down Expand Up @@ -211,6 +212,7 @@ internal class UploadBundlePathHandler(
logger.e(result.message)
throw HttpException(HttpStatus.BAD_REQUEST_400, result.message)
}
else -> Unit
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.jeppeman.globallydynamic.server

import com.jeppeman.globallydynamic.server.extensions.stackTraceToString
import com.jeppeman.globallydynamic.server.extensions.toBase64
import com.jeppeman.globallydynamic.server.server.BuildConfig
import org.eclipse.jetty.http.HttpStatus
import org.eclipse.jetty.server.Request
import org.eclipse.jetty.server.handler.AbstractHandler
Expand Down
Loading
Loading