diff --git a/README.md b/README.md index 1fc6928..dd8ebac 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ The plugin contains the following functionality: * Writes build information as fields to the `BuildConfig` class (see section [Build information](#build-information)) * Registers a task `injectMetadataIntoManifest` for each variant that injects the build information into the Android manifest -* Registers a task `generateAppIcon` for each variant that generates an app icon with the flavor name as overlay +* Registers a task `labelAppIcon` for each variant that generates an app icon with the flavor name as overlay * Registers a task `uploadToAlpaka` for each release variant that uploads the APK to the Alpaka backend ## Configuration diff --git a/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/AlpakaPlugin.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/AlpakaPlugin.kt index 1b011c7..c279e33 100644 --- a/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/AlpakaPlugin.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/AlpakaPlugin.kt @@ -6,7 +6,7 @@ import ch.ubique.gradle.alpaka.config.AlpakaPluginConfig import ch.ubique.gradle.alpaka.extensions.applicationvariant.launcherIconLabel import ch.ubique.gradle.alpaka.extensions.capitalize import ch.ubique.gradle.alpaka.extensions.getMergedManifestFile -import ch.ubique.gradle.alpaka.extensions.productflavor.launcherIconLabel as flavorLauncherIconLabel +import ch.ubique.gradle.alpaka.extensions.listFilesOrEmpty import ch.ubique.gradle.alpaka.extensions.productflavor.alpakaUploadKey import ch.ubique.gradle.alpaka.model.UploadRequest import ch.ubique.gradle.alpaka.task.IconTask @@ -25,6 +25,7 @@ import org.gradle.api.plugins.ExtensionAware import org.gradle.api.provider.Provider import org.jetbrains.kotlin.gradle.plugin.extraProperties import java.io.File +import ch.ubique.gradle.alpaka.extensions.productflavor.launcherIconLabel as flavorLauncherIconLabel abstract class AlpakaPlugin : Plugin { @@ -81,7 +82,8 @@ abstract class AlpakaPlugin : Plugin { "injectMetadataIntoManifest${variantName.capitalize()}", InjectMetadataIntoManifestTask::class.java ) { manifestTask -> - manifestTask.outputs.file(project.getMergedManifestFile(variantName)) + val mergedManifestFile = project.getMergedManifestFile(variantName) + manifestTask.mergedManifestFile = mergedManifestFile manifestTask.variantName = variantName manifestTask.flavor = flavor manifestTask.buildType = buildType @@ -90,10 +92,11 @@ abstract class AlpakaPlugin : Plugin { manifestTask.buildBatch = buildBatch manifestTask.buildTimestamp = buildTimestamp manifestTask.buildBranch = buildBranch + manifestTask.outputs.file(mergedManifestFile) } variant.outputs.forEach { output -> - output.processManifestProvider.get().finalizedBy(injectManifestTask) + output.processManifestProvider.configure { it.finalizedBy(injectManifestTask) } } project.tasks.named("process${variantName.capitalize()}ManifestForPackage") { it.dependsOn(injectManifestTask) @@ -128,16 +131,20 @@ abstract class AlpakaPlugin : Plugin { } val iconTask = project.tasks.register( - "generateAppIcon${variantName.capitalize()}", + "labelAppIcon${variantName.capitalize()}", IconTask::class.java ) { iconTask -> iconTask.variantName = variantName iconTask.flavor = flavor iconTask.buildType = buildType iconTask.labelValue = if (labelAppIcons) labelValue else null - iconTask.targetWebIconFile = getGeneratedWebIconFile(project.layout.buildDirectory, flavor, buildType) + iconTask.sourceWebIconFile = project.provider { findWebIcon(project.projectDir, flavor) } + iconTask.mergedManifestFile = project.getMergedManifestFile(variantName) + iconTask.generatedWebIcon = getGeneratedWebIconFile(project.layout.buildDirectory, flavor, buildType) iconTask.generatedIconDir = getGeneratedIconDir(project.layout.buildDirectory, flavor, buildType) iconTask.outputs.upToDateWhen { false } // always run the task + + iconTask.mustRunAfter(project.tasks.named("injectMetadataIntoManifest${variantName.capitalize()}")) } project.tasks.named("map${variantName.capitalize()}SourceSetPaths") { it.dependsOn(iconTask) } @@ -166,33 +173,32 @@ abstract class AlpakaPlugin : Plugin { "uploadToAlpaka${variantName.capitalize()}", UploadToAlpakaBackendTask::class.java ) { uploadTask -> - val uploadRequest = variant.outputs.first().let { - UploadRequest( - apk = it.outputFile, - appIcon = getGeneratedWebIconFile(project.layout.buildDirectory, flavor, buildType), - appName = "", // Will be set from manifest inside the task - packageName = packageName, - flavor = flavor, - branch = buildBranch, - minSdk = minSdk, - targetSdk = targetSdk, - usesFeature = emptyList(), // Will be set from manifest inside the task - buildId = buildId, - buildNumber = buildNumber, - buildTime = buildTimestamp, - buildBatch = buildBatch, - changelog = "", // Will be set inside the task - signature = "", // Will be set inside the task - version = versionName, - ) - } - uploadTask.variant = variant uploadTask.flavor = flavor uploadTask.buildType = buildType uploadTask.uploadKey = uploadKey ?: throw GradleException("No alpakaUploadKey specified") + uploadTask.mergedManifestFile = project.getMergedManifestFile(variantName) + uploadTask.apk = project.provider { variant.outputs.first().outputFile } + uploadTask.webIcon = getGeneratedWebIconFile(project.layout.buildDirectory, flavor, buildType) uploadTask.proxy = pluginExtension.proxy.orNull uploadTask.commitCount = pluginExtension.changelogCommitCount.orNull + + val uploadRequest = UploadRequest( + appName = "", // Will be set from manifest inside the task + packageName = packageName, + flavor = flavor, + branch = buildBranch, + minSdk = minSdk, + targetSdk = targetSdk, + usesFeature = emptyList(), // Will be set from manifest inside the task + buildId = buildId, + buildNumber = buildNumber, + buildTime = buildTimestamp, + buildBatch = buildBatch, + changelog = "", // Will be set inside the task + signature = "", // Will be set inside the task + version = versionName, + ) uploadTask.uploadRequest = uploadRequest uploadTask.dependsOn("assemble${variantName.capitalize()}") @@ -207,8 +213,16 @@ abstract class AlpakaPlugin : Plugin { return ext } + private fun findWebIcon(moduleDir: File, flavor: String): File { + val dirs = sequenceOf(File(moduleDir, "src/$flavor"), File(moduleDir, "src/main"), moduleDir) + return dirs + .flatMap { it.listFilesOrEmpty() } + .find { it.name.matches(Regex(".*(web|playstore|512)\\.(png|webp)")) } + ?: throw GradleException("Must provide web icon matching (web|playstore|512).(png|webp) in one of the following locations:\n ${dirs.joinToString()}") + } + private fun getGeneratedWebIconFile(buildDir: DirectoryProperty, flavor: String, buildType: String): Provider { - return getGeneratedIconDir(buildDir, flavor, buildType).map { it.file("web-icon.png").asFile } + return buildDir.file("outputs/launcher-icon/$flavor/$buildType/web-icon.png").map { it.asFile } } private fun getGeneratedIconDir(buildDir: DirectoryProperty, flavor: String, buildType: String): Provider { diff --git a/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/FileExtensions.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/FileExtensions.kt index df8b321..afd31fc 100644 --- a/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/FileExtensions.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/FileExtensions.kt @@ -6,4 +6,8 @@ fun File?.olderThan(other: File, orLastModified: Long): Boolean { return this?.lastModified()?.let { other.lastModified() > it || orLastModified > it } ?: true -} \ No newline at end of file +} + +fun File.listFilesOrEmpty(): List { + return listFiles()?.asList() ?: emptyList() +} diff --git a/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/ProjectExtensions.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/ProjectExtensions.kt index 77d3e27..2561265 100644 --- a/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/ProjectExtensions.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/ProjectExtensions.kt @@ -1,22 +1,20 @@ package ch.ubique.gradle.alpaka.extensions - import com.android.build.gradle.BaseExtension import org.gradle.api.Project import org.gradle.api.artifacts.ProjectDependency +import org.gradle.api.provider.Provider import java.io.File /** * returns File with merged manifest */ -fun Project.getMergedManifestFile(variantName: String): File { - return File( - layout.buildDirectory.asFile.get(), - "intermediates/merged_manifests/${variantName}/process${variantName.capitalize()}Manifest/AndroidManifest.xml" - ) +fun Project.getMergedManifestFile(variantName: String): Provider { + return layout.buildDirectory + .file("intermediates/merged_manifests/${variantName}/process${variantName.capitalize()}Manifest/AndroidManifest.xml") + .map { it.asFile } } - fun Project.getResDirs(flavor: String): List { val androidModules: List = configurations .asSequence() diff --git a/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/model/UploadRequest.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/model/UploadRequest.kt index e383a3a..38e55f6 100644 --- a/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/model/UploadRequest.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/model/UploadRequest.kt @@ -1,12 +1,8 @@ package ch.ubique.gradle.alpaka.model import ch.ubique.gradle.alpaka.network.dto.UploadDataDto -import org.gradle.api.provider.Provider -import java.io.File data class UploadRequest( - val apk: File, - val appIcon: Provider, val appName: String, val packageName: String, val flavor: String, diff --git a/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/network/BackendRepository.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/network/BackendRepository.kt index b358546..5d28f19 100644 --- a/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/network/BackendRepository.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/network/BackendRepository.kt @@ -44,16 +44,16 @@ class BackendRepository { resetService() } - fun appsUpload(uploadRequest: UploadRequest, uploadKey: String) { + fun appsUpload(uploadRequest: UploadRequest, apk: File, appIcon: File, uploadKey: String) { val data = MoshiBuilder.createMoshi() .toJson(uploadRequest.toUploadDataJson(uploadKey = uploadKey)) .toByteArray() .toRequestBody("application/json".toMediaType()) val response = service.appsUpload( - apk = uploadRequest.apk.toPartMap("apk", "application/octet-stream"), - icon = uploadRequest.appIcon.get().toPartMap("icon", "image/png"), - data = data + apk = apk.toPartMap("apk", "application/octet-stream"), + icon = appIcon.toPartMap("icon", "image/png"), + data = data, ).execute() if (response.isSuccessful.not()) throw HttpException(response) diff --git a/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/IconTask.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/IconTask.kt index 5e69e9a..d645641 100644 --- a/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/IconTask.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/IconTask.kt @@ -1,11 +1,9 @@ package ch.ubique.gradle.alpaka.task -import ch.ubique.gradle.alpaka.extensions.getMergedManifestFile import ch.ubique.gradle.alpaka.extensions.getResDirs import ch.ubique.gradle.alpaka.extensions.olderThan import ch.ubique.gradle.alpaka.utils.IconUtils import org.gradle.api.DefaultTask -import org.gradle.api.GradleException import org.gradle.api.file.Directory import org.gradle.api.provider.Provider import org.gradle.api.tasks.* @@ -32,23 +30,31 @@ abstract class IconTask : DefaultTask() { @get:Optional abstract var labelValue: String? - @get:Input - abstract var targetWebIconFile: Provider + @get:InputFile + @get:PathSensitive(PathSensitivity.RELATIVE) + abstract var mergedManifestFile: Provider + + @get:InputFile + @get:PathSensitive(PathSensitivity.RELATIVE) + abstract var sourceWebIconFile: Provider @get:OutputDirectory abstract var generatedIconDir: Provider + @get:OutputFile + abstract var generatedWebIcon: Provider + @TaskAction fun iconAction() { - val moduleDir = File(project.rootDir, project.name) - val targetWebIcon = targetWebIconFile.get().also { + val webIconTarget = generatedWebIcon.get().also { it.parentFile.mkdirs() it.createNewFile() } + val generatedIconDir = generatedIconDir.get().asFile val gradleLastModified = listOf( - File(moduleDir, "build.gradle").lastModified(), - File(moduleDir, "build.gradle.kts").lastModified(), + File(project.projectDir, "build.gradle").lastModified(), + File(project.projectDir, "build.gradle.kts").lastModified(), File(project.rootDir, "build.gradle").lastModified(), File(project.rootDir, "build.gradle.kts").lastModified(), File(project.rootDir, "settings.gradle").lastModified(), @@ -56,35 +62,32 @@ abstract class IconTask : DefaultTask() { File(project.rootDir, "gradle/libs.versions.toml").lastModified(), ).max() - val manifestFile = project.getMergedManifestFile(variantName) val resDirs = project.getResDirs(flavor) - val allIcons = IconUtils.findIcons(resDirs, manifestFile) + val allIcons = IconUtils.findIcons(resDirs, mergedManifestFile.get()) - val webIconSource = ( - (File(moduleDir, "src/$flavor").listFiles() ?: arrayOf()) + - (File(moduleDir, "src/main").listFiles() ?: arrayOf()) + - (moduleDir.listFiles() ?: arrayOf()) - ).find { it.name.matches(Regex(".*(web|playstore|512)\\.(png|webp)")) } - ?: throw GradleException("Web icon source not found") + val webIconSource = sourceWebIconFile.get() val bannerLabel = labelValue if (bannerLabel.isNullOrEmpty()) { - if (webIconSource.olderThan(targetWebIcon, gradleLastModified)) { + // delete any unwanted files + generatedIconDir.deleteRecursively() + // copy web icon as-is + if (webIconSource.olderThan(webIconTarget, gradleLastModified)) { logger.info("No banner label, copy source icon") - webIconSource.copyTo(targetWebIcon, overwrite = true) + webIconSource.copyTo(webIconTarget, overwrite = true) } } else { - if (webIconSource.olderThan(targetWebIcon, gradleLastModified)) { + if (webIconSource.olderThan(webIconTarget, gradleLastModified)) { logger.info("Apply banner label to web icon: ${webIconSource.absolutePath}") - IconUtils.drawLabel(webIconSource, targetWebIcon, bannerLabel, adaptive = false) + IconUtils.drawLabel(webIconSource, webIconTarget, bannerLabel, adaptive = false) } allIcons.forEach iconsForEach@{ original -> val resTypeName = original.parentFile.name val originalBaseName = original.name.substringBefore(".") - val targetDir = File(generatedIconDir.get().asFile, resTypeName) + val targetDir = File(generatedIconDir, resTypeName) val modified = targetDir.listFiles { file -> file.name.matches(Regex("$originalBaseName\\.[^.]+")) diff --git a/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/InjectMetadataIntoManifestTask.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/InjectMetadataIntoManifestTask.kt index dff7802..4a67112 100644 --- a/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/InjectMetadataIntoManifestTask.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/InjectMetadataIntoManifestTask.kt @@ -1,9 +1,10 @@ package ch.ubique.gradle.alpaka.task -import ch.ubique.gradle.alpaka.extensions.getMergedManifestFile import org.gradle.api.DefaultTask import org.gradle.api.GradleException +import org.gradle.api.provider.Provider import org.gradle.api.tasks.Input +import org.gradle.api.tasks.InputFile import org.gradle.api.tasks.TaskAction import org.gradle.work.DisableCachingByDefault import java.io.File @@ -49,9 +50,12 @@ abstract class InjectMetadataIntoManifestTask : DefaultTask() { @get:Input abstract var buildBranch: String + @get:InputFile + abstract var mergedManifestFile: Provider + @TaskAction fun injectMetadataIntoManifest() { - val manifestFile = project.getMergedManifestFile(variantName) + val manifestFile = mergedManifestFile.get() if (manifestFile.exists()) { manipulateManifestFile(manifestFile) } else { diff --git a/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/UploadToAlpakaBackendTask.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/UploadToAlpakaBackendTask.kt index 7673d1a..ca03ddf 100644 --- a/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/UploadToAlpakaBackendTask.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/UploadToAlpakaBackendTask.kt @@ -2,23 +2,25 @@ package ch.ubique.gradle.alpaka.task -import ch.ubique.gradle.alpaka.extensions.getMergedManifestFile import ch.ubique.gradle.alpaka.extensions.getResDirs import ch.ubique.gradle.alpaka.model.UploadRequest import ch.ubique.gradle.alpaka.network.BackendRepository import ch.ubique.gradle.alpaka.network.OkHttpInstance import ch.ubique.gradle.alpaka.utils.GitUtils +import ch.ubique.gradle.alpaka.utils.ManifestUtils import ch.ubique.gradle.alpaka.utils.SigningConfigUtils -import ch.ubique.gradle.alpaka.utils.StringUtils import com.android.build.gradle.api.ApplicationVariant import org.gradle.api.DefaultTask import org.gradle.api.GradleException +import org.gradle.api.provider.Provider import org.gradle.api.tasks.Input +import org.gradle.api.tasks.InputFile import org.gradle.api.tasks.Optional import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.options.Option import org.gradle.work.DisableCachingByDefault import retrofit2.HttpException +import java.io.File @DisableCachingByDefault abstract class UploadToAlpakaBackendTask : DefaultTask() { @@ -53,13 +55,22 @@ abstract class UploadToAlpakaBackendTask : DefaultTask() { @get:Input abstract var uploadRequest: UploadRequest + @get:InputFile + abstract var mergedManifestFile: Provider + + @get:InputFile + abstract var apk: Provider + + @get:InputFile + abstract var webIcon: Provider + @TaskAction fun uploadAction() { - - proxy?.let { - val proxyVal = it.split(":") - OkHttpInstance.setProxy(proxyVal[0], proxyVal[1].toInt()) - } ?: run { + val proxy = proxy + if (proxy != null) { + val (host, port) = proxy.split(":") + OkHttpInstance.setProxy(host, port.toInt()) + } else { OkHttpInstance.setProxy(null) } @@ -76,7 +87,7 @@ abstract class UploadToAlpakaBackendTask : DefaultTask() { logger.lifecycle("Starting upload to Alpaka.") try { val backendRepository = BackendRepository() - backendRepository.appsUpload(uploadRequest = uploadRequest, uploadKey = uploadKey) + backendRepository.appsUpload(uploadRequest, apk.get(), webIcon.get(), uploadKey) logger.lifecycle("Upload to Alpaka successful.") } catch (e: Exception) { val message = if (e is HttpException) { @@ -91,10 +102,10 @@ abstract class UploadToAlpakaBackendTask : DefaultTask() { } private fun updateUploadRequestWithManifestInformation(): UploadRequest { - val manifestFile = project.getMergedManifestFile(variant.name) + val manifestFile = mergedManifestFile.get() val resDirs = project.getResDirs(flavor) - val appName = StringUtils.findAppName(logger, resDirs, manifestFile) + val appName = ManifestUtils.findAppName(logger, resDirs, manifestFile) ?: throw GradleException( """ Failed to find app name in string resources. @@ -103,7 +114,7 @@ abstract class UploadToAlpakaBackendTask : DefaultTask() { """.trimIndent() ) - val usesFeatures = StringUtils.findRequiredFeatures(manifestFile) + val usesFeatures = ManifestUtils.findRequiredFeatures(manifestFile) return uploadRequest.copy( appName = appName, diff --git a/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/StringUtils.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/ManifestUtils.kt similarity index 82% rename from alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/StringUtils.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/ManifestUtils.kt index 496e96b..532f374 100644 --- a/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/StringUtils.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/ManifestUtils.kt @@ -3,13 +3,17 @@ package ch.ubique.gradle.alpaka.utils import org.gradle.api.logging.Logger import java.io.File -object StringUtils { +object ManifestUtils { /** * Finds the app name from specified in the manifest. */ fun findAppName(logger: Logger, resDirs: List, manifest: File): String? { - val labelName = findAttributeValue(manifest, "application", "android:label")?.substringAfter("/") ?: return null + val labelName = findAttributeValue(manifest, "application", "android:label")?.substringAfter("/") + if (labelName.isNullOrEmpty()) { + logger.warn(" not found in manifest") + return null + } val stringFiles = resDirs.filter { it.exists() } .flatMap { resDir -> @@ -49,23 +53,16 @@ object StringUtils { val features = xmlParser.findAttributeValues("uses-feature", "android:name", mapOf("android:required" to "true")) val openGl = xmlParser.findAttributeValues("uses-feature", "android:glEsVersion", mapOf("android:required" to "true")).map { when (it) { - "0x00020000" -> "OpenGL 2.0" - "0x00030002" -> "OpenGL 3.2" - else -> "OpenGL $it" + "0x00020000" -> "android.opengl.GLES20" + "0x00030000" -> "android.opengl.GLES30" + "0x00030001" -> "android.opengl.GLES31" + "0x00030002" -> "android.opengl.GLES32" + else -> "android.opengl.GLES/$it" } } return features + openGl } - fun findMetadataValue(manifest: File, name: String): String? { - if (manifest.isDirectory || manifest.exists().not()) { - return null - } - - val xmlParser = XmlParser(manifest) - return xmlParser.findAttributeValue("meta-data", "android:value", mapOf("android:name" to name)) - } - private fun findAttributeValue(manifest: File, tag: String, attribute: String): String? { if (manifest.isDirectory || manifest.exists().not()) { return null diff --git a/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/SigningConfigUtils.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/SigningConfigUtils.kt index a9e3c3e..340a172 100644 --- a/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/SigningConfigUtils.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/SigningConfigUtils.kt @@ -35,7 +35,7 @@ class SigningConfigUtils(private val logger: Logger) { return entry.certificate } - private fun getFingerprint(certificate: Certificate, hashAlgorithm: String): String? { + private fun getFingerprint(certificate: Certificate, hashAlgorithm: String): String { val digest = MessageDigest.getInstance(hashAlgorithm) return digest.digest(certificate.encoded).toHexadecimalString() } diff --git a/alpaka/plugin/src/test/java/ch/ubique/gradle/alpaka/AlpakaPluginTest.kt b/alpaka/plugin/src/test/java/ch/ubique/gradle/alpaka/AlpakaPluginTest.kt index dabf984..f522922 100644 --- a/alpaka/plugin/src/test/java/ch/ubique/gradle/alpaka/AlpakaPluginTest.kt +++ b/alpaka/plugin/src/test/java/ch/ubique/gradle/alpaka/AlpakaPluginTest.kt @@ -16,7 +16,7 @@ class AlpakaPluginTest { GradleRunner.create() .withProjectDir(projectpath) - .withArguments("appexample:generateAppIconDevDebug", "-PubiqueMavenRootUrl=abc", "-PubiqueMavenRepoName=abc", "-PubiqueMavenUser=abc", "-PubiqueMavenPass=abc") + .withArguments("appexample:labelAppIconDevDebug", "-PubiqueMavenRootUrl=abc", "-PubiqueMavenRepoName=abc", "-PubiqueMavenUser=abc", "-PubiqueMavenPass=abc") //.withPluginClasspath() .build() */