diff --git a/.github/workflows/release_artifactory.yml b/.github/workflows/release_artifactory.yml index 47acebc..9dc407e 100644 --- a/.github/workflows/release_artifactory.yml +++ b/.github/workflows/release_artifactory.yml @@ -9,7 +9,7 @@ jobs: publish: uses: UbiqueInnovation/actions-android/.github/workflows/android_gradle_task.yml@v1.6.4 with: - task: 'clean :linth:artifactoryPublish' + task: 'clean :alpaka:artifactoryPublish' concurrencyGroup: ${{ github.workflow }}-${{ github.ref }} gradleArgs: '-PgithubRefName=${{ github.ref_name }}' secrets: diff --git a/README.md b/README.md index 7b60450..e52edea 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Linth Gradle Plugin +# Alpaka Gradle Plugin -This plugin configures an Android project for build and upload to the Ubique Linth backend. +This plugin configures an Android project for build and upload to the Ubique Alpaka backend. ## Functionality @@ -11,7 +11,7 @@ The plugin contains the following functionality: * 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 `uploadToLinth` for each release variant that uploads the APK to the Linth backend +* Registers a task `uploadToAlpaka` for each release variant that uploads the APK to the Alpaka backend ## Configuration @@ -19,23 +19,23 @@ After applying the plugin to your project, you can set the following configurati ```kotlin android { - defaultConfig { - launcherIconLabel = "tescht" // The default icon label per flavor (optional, nullable) - linthUploadKey = "..." // The upload key identifying an application in the Linth backend - } - + defaultConfig { + launcherIconLabel = "tescht" // The default icon label per flavor (optional, nullable) + alpakaUploadKey = "..." // The upload key identifying an application in the Alpaka backend + } + productFlavors { - create("dev") { - launcherIconLabel = "tescht" // Modify the default icon label per flavor (optional, nullable) - linthUploadKey = "..." // Modify the default uploadKey per flavor (optional) - } - } + create("dev") { + launcherIconLabel = "tescht" // Modify the default icon label per flavor (optional, nullable) + alpakaUploadKey = "..." // Modify the default uploadKey per flavor (optional) + } + } } -linth { - changelogCommitCount = 10 // The number of commits to include in the changelog (optional, defaults to 10) - proxy = "host:port" // An optional proxy to set for the upload task. Use for local debugging only - labelAppIcons = false // Globally configure the generateAppIcon tasks to label with flavor name (optional, default is enabled) +alpaka { + changelogCommitCount = 10 // The number of commits to include in the changelog (optional, defaults to 10) + proxy = "host:port" // An optional proxy to set for the upload task. Use for local debugging only + labelAppIcons = false // Globally configure the generateAppIcon tasks to label with flavor name (optional, default is enabled) } ``` @@ -43,11 +43,11 @@ linth { These are the build information that are written to the `BuildConfig` class and Android manifest: -| BuildConfig name | Android manifest name | Description | Value | -|-------------------|-----------------------------------|--------------------------------------------------------------------------|-----------------------------------------------------------------------------| -| `BUILD_BATCH` | `ch.ubique.linth.build.batch` | An ID for a group of builds that belong together (e.g. multiple flavors) | `build_batch` Gradle property, defaults to `0` | -| `BUILD_ID` | `ch.ubique.linth.build.id` | An ID for this build | `build_id` or `ubappid` Gradle property, defaults to `localbuild` | -| `BUILD_NUMBER` | `ch.ubique.linth.build.number` | An incremental number of this build | `build_number` Gradle property, defaults to `0` | -| `BUILD_TIMESTAMP` | `ch.ubique.linth.build.timestamp` | The timestamp of this build | `build_timestamp` Gradle property, defaults to `System.currentTimeMillis()` | -| `BRANCH` | `ch.ubique.linth.branch` | The Git branch this build was created from | `branch` Gradle property, defaults to calling the systems Git command line | -| `FLAVOR` | `ch.ubique.linth.flavor` | The product flavor this build was created from | Product flavor name of the variant that started the gradle task | \ No newline at end of file +| BuildConfig name | Android manifest name | Description | Value | +|-------------------|------------------------------------|--------------------------------------------------------------------------|-----------------------------------------------------------------------------| +| `BUILD_BATCH` | `ch.ubique.alpaka.build.batch` | An ID for a group of builds that belong together (e.g. multiple flavors) | `build_batch` Gradle property, defaults to `0` | +| `BUILD_ID` | `ch.ubique.alpaka.build.id` | An ID for this build | `build_id` or `ubappid` Gradle property, defaults to `localbuild` | +| `BUILD_NUMBER` | `ch.ubique.alpaka.build.number` | An incremental number of this build | `build_number` Gradle property, defaults to `0` | +| `BUILD_TIMESTAMP` | `ch.ubique.alpaka.build.timestamp` | The timestamp of this build | `build_timestamp` Gradle property, defaults to `System.currentTimeMillis()` | +| `BRANCH` | `ch.ubique.alpaka.branch` | The Git branch this build was created from | `branch` Gradle property, defaults to calling the systems Git command line | +| `FLAVOR` | `ch.ubique.alpaka.flavor` | The product flavor this build was created from | Product flavor name of the variant that started the gradle task | \ No newline at end of file diff --git a/linth/build.gradle.kts b/alpaka/build.gradle.kts similarity index 100% rename from linth/build.gradle.kts rename to alpaka/build.gradle.kts diff --git a/alpaka/gradle.properties b/alpaka/gradle.properties new file mode 100644 index 0000000..40333ed --- /dev/null +++ b/alpaka/gradle.properties @@ -0,0 +1,10 @@ +ID=ch.ubique.gradle.alpaka +GROUP=ch.ubique.gradle +ARTIFACT_ID=alpaka +# VERSION will only be used if no property "githubRefName" is set (which the release workflow does) +VERSION=0.0.0 +DISPLAY_NAME=Ubique Alpaka +DESCRIPTION=Adds tasks to apply flavor-specific icon overlays, inject build metadata into the Android manifest and upload the APK to the Ubique Alpaka backend +WEBSITE=https://github.com/UbiqueInnovation/gradle-plugin-alpaka-android +VCS_URL=https://github.com/UbiqueInnovation/gradle-plugin-alpaka-android +IMPLEMENTATION_CLASS=ch.ubique.gradle.alpaka.AlpakaPlugin diff --git a/linth/gradle/wrapper/gradle-wrapper.jar b/alpaka/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from linth/gradle/wrapper/gradle-wrapper.jar rename to alpaka/gradle/wrapper/gradle-wrapper.jar diff --git a/linth/gradle/wrapper/gradle-wrapper.properties b/alpaka/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from linth/gradle/wrapper/gradle-wrapper.properties rename to alpaka/gradle/wrapper/gradle-wrapper.properties diff --git a/linth/gradlew b/alpaka/gradlew similarity index 100% rename from linth/gradlew rename to alpaka/gradlew diff --git a/linth/gradlew.bat b/alpaka/gradlew.bat similarity index 100% rename from linth/gradlew.bat rename to alpaka/gradlew.bat diff --git a/linth/plugin/build.gradle.kts b/alpaka/plugin/build.gradle.kts similarity index 100% rename from linth/plugin/build.gradle.kts rename to alpaka/plugin/build.gradle.kts diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/LinthPlugin.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/AlpakaPlugin.kt similarity index 88% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/LinthPlugin.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/AlpakaPlugin.kt index f227d87..df2f34d 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/LinthPlugin.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/AlpakaPlugin.kt @@ -1,17 +1,16 @@ @file:Suppress("DEPRECATION") -package ch.ubique.gradle.linth - -import ch.ubique.gradle.linth.config.LinthPluginConfig -import ch.ubique.gradle.linth.extensions.capitalize -import ch.ubique.gradle.linth.extensions.getMergedManifestFile -import ch.ubique.gradle.linth.extensions.productflavor.launcherIconLabel -import ch.ubique.gradle.linth.extensions.productflavor.linthUploadKey -import ch.ubique.gradle.linth.model.UploadRequest -import ch.ubique.gradle.linth.task.IconTask -import ch.ubique.gradle.linth.task.InjectMetadataIntoManifestTask -import ch.ubique.gradle.linth.task.UploadToLinthBackendTask -import ch.ubique.gradle.linth.utils.GitUtils +package ch.ubique.gradle.alpaka + +import ch.ubique.gradle.alpaka.config.AlpakaPluginConfig +import ch.ubique.gradle.alpaka.extensions.getMergedManifestFile +import ch.ubique.gradle.alpaka.extensions.productflavor.alpakaUploadKey +import ch.ubique.gradle.alpaka.extensions.productflavor.launcherIconLabel +import ch.ubique.gradle.alpaka.model.UploadRequest +import ch.ubique.gradle.alpaka.task.IconTask +import ch.ubique.gradle.alpaka.task.InjectMetadataIntoManifestTask +import ch.ubique.gradle.alpaka.task.UploadToAlpakaBackendTask +import ch.ubique.gradle.alpaka.utils.GitUtils import com.android.build.gradle.AppExtension import com.android.build.gradle.api.ApplicationVariant import com.android.build.gradle.internal.tasks.factory.dependsOn @@ -22,10 +21,10 @@ import org.gradle.api.plugins.ExtensionAware import org.jetbrains.kotlin.gradle.plugin.extraProperties import java.io.File -abstract class LinthPlugin : Plugin { +abstract class AlpakaPlugin : Plugin { override fun apply(project: Project) { - val pluginExtension = project.extensions.create("linth", LinthPluginConfig::class.java, project) + val pluginExtension = project.extensions.create("alpaka", AlpakaPluginConfig::class.java, project) val androidExtension = getAndroidExtension(project) // The build ID is a unique UUID for each build @@ -58,11 +57,11 @@ abstract class LinthPlugin : Plugin { //specify extra properties per flavor and defaultConfig for groovy dsl (androidExtension.defaultConfig as ExtensionAware).apply { extraProperties.set("launcherIconLabel", null) - extraProperties.set("linthUploadKey", null) + extraProperties.set("alpakaUploadKey", null) } androidExtension.productFlavors.configureEach { flavor -> flavor.extraProperties.set("launcherIconLabel", null) - flavor.extraProperties.set("linthUploadKey", null) + flavor.extraProperties.set("alpakaUploadKey", null) } // Hook injectMetadataTask into android build process @@ -185,14 +184,14 @@ abstract class LinthPlugin : Plugin { } project.tasks.register( - "uploadToLinth${variantName.capitalize()}", - UploadToLinthBackendTask::class.java + "uploadToAlpaka${variantName.capitalize()}", + UploadToAlpakaBackendTask::class.java ) { uploadTask -> uploadTask.dependsOn("assemble${variantName.capitalize()}") uploadTask.variant = variant uploadTask.flavor = flavor uploadTask.buildType = buildType - uploadTask.uploadKey = uploadKey ?: throw GradleException("No linthUploadKey specified") + uploadTask.uploadKey = uploadKey ?: throw GradleException("No alpakaUploadKey specified") uploadTask.proxy = pluginExtension.proxy.orNull uploadTask.commitCount = pluginExtension.changelogCommitCount.orNull uploadTask.uploadRequest = uploadRequest @@ -217,7 +216,7 @@ abstract class LinthPlugin : Plugin { private fun uploadKey(applicationVariant: ApplicationVariant, androidExtension: AppExtension): String? { val productFlavor = applicationVariant.productFlavors.firstOrNull() - return productFlavor?.linthUploadKey ?: androidExtension.defaultConfig.linthUploadKey + return productFlavor?.alpakaUploadKey ?: androidExtension.defaultConfig.alpakaUploadKey } diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/config/LinthPluginConfig.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/config/AlpakaPluginConfig.kt similarity index 85% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/config/LinthPluginConfig.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/config/AlpakaPluginConfig.kt index cec73f4..4059dc6 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/config/LinthPluginConfig.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/config/AlpakaPluginConfig.kt @@ -1,11 +1,11 @@ -package ch.ubique.gradle.linth.config +package ch.ubique.gradle.alpaka.config import org.gradle.api.Project import org.gradle.api.provider.Property import javax.inject.Inject @Suppress("UnnecessaryAbstractClass") -abstract class LinthPluginConfig +abstract class AlpakaPluginConfig @Inject constructor(project: Project) { private val objects = project.objects diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/extensions/FileExtensions.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/FileExtensions.kt similarity index 81% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/extensions/FileExtensions.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/FileExtensions.kt index d29f037..df8b321 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/extensions/FileExtensions.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/FileExtensions.kt @@ -1,4 +1,4 @@ -package ch.ubique.gradle.linth.extensions +package ch.ubique.gradle.alpaka.extensions import java.io.File diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/extensions/MoshiExtensions.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/MoshiExtensions.kt similarity index 94% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/extensions/MoshiExtensions.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/MoshiExtensions.kt index 89bb704..42bccb5 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/extensions/MoshiExtensions.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/MoshiExtensions.kt @@ -1,4 +1,4 @@ -package ch.ubique.gradle.linth.extensions +package ch.ubique.gradle.alpaka.extensions import com.squareup.moshi.JsonAdapter import com.squareup.moshi.Moshi diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/extensions/ProjectExtensions.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/ProjectExtensions.kt similarity index 95% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/extensions/ProjectExtensions.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/ProjectExtensions.kt index e6b4be1..77d3e27 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/extensions/ProjectExtensions.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/ProjectExtensions.kt @@ -1,4 +1,4 @@ -package ch.ubique.gradle.linth.extensions +package ch.ubique.gradle.alpaka.extensions import com.android.build.gradle.BaseExtension diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/extensions/StringExtensions.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/StringExtensions.kt similarity index 77% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/extensions/StringExtensions.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/StringExtensions.kt index 62de5ab..8ea8ef7 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/extensions/StringExtensions.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/StringExtensions.kt @@ -1,4 +1,4 @@ -package ch.ubique.gradle.linth.extensions +package ch.ubique.gradle.alpaka.extensions import java.util.* diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/extensions/applicationvariant/ApplicationVariantDimensionExtensions.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/applicationvariant/ApplicationVariantDimensionExtensions.kt similarity index 75% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/extensions/applicationvariant/ApplicationVariantDimensionExtensions.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/applicationvariant/ApplicationVariantDimensionExtensions.kt index 0cae18f..e1ab1ee 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/extensions/applicationvariant/ApplicationVariantDimensionExtensions.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/applicationvariant/ApplicationVariantDimensionExtensions.kt @@ -1,4 +1,4 @@ -package ch.ubique.gradle.linth.extensions.applicationvariant +package ch.ubique.gradle.alpaka.extensions.applicationvariant import com.android.build.api.dsl.ApplicationVariantDimension import org.gradle.api.plugins.ExtensionAware @@ -13,6 +13,6 @@ var ApplicationVariantDimension.launcherIconLabel: String? get() = error("only setter") set(value) = setProperty("launcherIconLabel", value) -var ApplicationVariantDimension.linthUploadKey: String? +var ApplicationVariantDimension.alpakaUploadKey: String? get() = error("only setter") - set(value) = setProperty("linthUploadKey", value) \ No newline at end of file + set(value) = setProperty("alpakaUploadKey", value) \ No newline at end of file diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/extensions/productflavor/ProductFlavorExtensions.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/productflavor/ProductFlavorExtensions.kt similarity index 86% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/extensions/productflavor/ProductFlavorExtensions.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/productflavor/ProductFlavorExtensions.kt index b322cf9..34a96b9 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/extensions/productflavor/ProductFlavorExtensions.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/extensions/productflavor/ProductFlavorExtensions.kt @@ -1,4 +1,4 @@ -package ch.ubique.gradle.linth.extensions.productflavor +package ch.ubique.gradle.alpaka.extensions.productflavor import com.android.build.gradle.internal.api.ReadOnlyProductFlavor import com.android.builder.model.ProductFlavor @@ -27,5 +27,5 @@ internal var ProductFlavor.launcherIconLabel: String? get() = getProperty("launcherIconLabel") set(value) = setProperty("launcherIconLabel", value) -internal val ProductFlavor.linthUploadKey: String? - get() = getProperty("linthUploadKey") \ No newline at end of file +internal val ProductFlavor.alpakaUploadKey: String? + get() = getProperty("alpakaUploadKey") \ No newline at end of file diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/model/UploadRequest.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/model/UploadRequest.kt similarity index 89% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/model/UploadRequest.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/model/UploadRequest.kt index 896cc6e..8aa08f6 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/model/UploadRequest.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/model/UploadRequest.kt @@ -1,6 +1,6 @@ -package ch.ubique.gradle.linth.model +package ch.ubique.gradle.alpaka.model -import ch.ubique.gradle.linth.network.dto.UploadDataDto +import ch.ubique.gradle.alpaka.network.dto.UploadDataDto import java.io.File data class UploadRequest( diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/network/BackendRepository.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/network/BackendRepository.kt similarity index 85% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/network/BackendRepository.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/network/BackendRepository.kt index daf05cb..98607d5 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/network/BackendRepository.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/network/BackendRepository.kt @@ -1,8 +1,8 @@ -package ch.ubique.gradle.linth.network +package ch.ubique.gradle.alpaka.network -import ch.ubique.gradle.linth.extensions.toJson -import ch.ubique.gradle.linth.model.UploadRequest -import ch.ubique.gradle.linth.network.moshi.MoshiBuilder +import ch.ubique.gradle.alpaka.extensions.toJson +import ch.ubique.gradle.alpaka.model.UploadRequest +import ch.ubique.gradle.alpaka.network.moshi.MoshiBuilder import okhttp3.MediaType.Companion.toMediaType import okhttp3.RequestBody import okhttp3.RequestBody.Companion.asRequestBody @@ -29,7 +29,7 @@ class BackendRepository { try { val httpClient = OkHttpInstance.getPreconfiguredClient() _service = Retrofit.Builder() - .baseUrl("https://linth-ws.ubique.ch/v1/") + .baseUrl("https://linth-ws.ubique.ch/v1/") // TODO Update base url to Alpaka once backend is migrated .addConverterFactory(ScalarsConverterFactory.create()) .client(httpClient) .build() diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/network/BackendService.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/network/BackendService.kt similarity index 91% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/network/BackendService.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/network/BackendService.kt index eb393b9..07bb038 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/network/BackendService.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/network/BackendService.kt @@ -1,4 +1,4 @@ -package ch.ubique.gradle.linth.network +package ch.ubique.gradle.alpaka.network import okhttp3.RequestBody import retrofit2.Call diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/network/OkHttpInstance.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/network/OkHttpInstance.kt similarity index 97% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/network/OkHttpInstance.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/network/OkHttpInstance.kt index d2ca0f4..cae5721 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/network/OkHttpInstance.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/network/OkHttpInstance.kt @@ -1,4 +1,4 @@ -package ch.ubique.gradle.linth.network +package ch.ubique.gradle.alpaka.network import okhttp3.OkHttpClient import java.net.InetSocketAddress diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/network/dto/UploadDataDto.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/network/dto/UploadDataDto.kt similarity index 91% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/network/dto/UploadDataDto.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/network/dto/UploadDataDto.kt index c5539f6..ce976ca 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/network/dto/UploadDataDto.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/network/dto/UploadDataDto.kt @@ -1,4 +1,4 @@ -package ch.ubique.gradle.linth.network.dto +package ch.ubique.gradle.alpaka.network.dto import com.squareup.moshi.JsonClass diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/network/moshi/MoshiBuilder.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/network/moshi/MoshiBuilder.kt similarity index 83% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/network/moshi/MoshiBuilder.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/network/moshi/MoshiBuilder.kt index 534e563..8c6f78b 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/network/moshi/MoshiBuilder.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/network/moshi/MoshiBuilder.kt @@ -1,4 +1,4 @@ -package ch.ubique.gradle.linth.network.moshi +package ch.ubique.gradle.alpaka.network.moshi import com.squareup.moshi.Moshi import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/task/IconTask.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/IconTask.kt similarity index 91% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/task/IconTask.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/IconTask.kt index 9ae5af6..c1ff229 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/task/IconTask.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/IconTask.kt @@ -1,9 +1,9 @@ -package ch.ubique.gradle.linth.task +package ch.ubique.gradle.alpaka.task -import ch.ubique.gradle.linth.extensions.getMergedManifestFile -import ch.ubique.gradle.linth.extensions.getResDirs -import ch.ubique.gradle.linth.extensions.olderThan -import ch.ubique.gradle.linth.utils.IconUtils +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.tasks.* @@ -13,7 +13,7 @@ import java.io.File abstract class IconTask : DefaultTask() { init { - group = "linth" + group = "alpaka" description = "Generate app icon with flavor label overlay" } diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/task/InjectMetadataIntoManifestTask.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/InjectMetadataIntoManifestTask.kt similarity index 82% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/task/InjectMetadataIntoManifestTask.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/InjectMetadataIntoManifestTask.kt index 0a5f809..dff7802 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/task/InjectMetadataIntoManifestTask.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/InjectMetadataIntoManifestTask.kt @@ -1,6 +1,6 @@ -package ch.ubique.gradle.linth.task +package ch.ubique.gradle.alpaka.task -import ch.ubique.gradle.linth.extensions.getMergedManifestFile +import ch.ubique.gradle.alpaka.extensions.getMergedManifestFile import org.gradle.api.DefaultTask import org.gradle.api.GradleException import org.gradle.api.tasks.Input @@ -12,16 +12,16 @@ import java.io.File abstract class InjectMetadataIntoManifestTask : DefaultTask() { companion object { - const val METADATA_KEY_BUILD_BATCH = "ch.ubique.linth.build.batch" - const val METADATA_KEY_BUILD_ID = "ch.ubique.linth.build.id" - const val METADATA_KEY_BUILD_NUMBER = "ch.ubique.linth.build.number" - const val METADATA_KEY_BUILD_TIMESTAMP = "ch.ubique.linth.build.timestamp" - const val METADATA_KEY_BRANCH = "ch.ubique.linth.branch" - const val METADATA_KEY_FLAVOR = "ch.ubique.linth.flavor" + const val METADATA_KEY_BUILD_BATCH = "ch.ubique.alpaka.build.batch" + const val METADATA_KEY_BUILD_ID = "ch.ubique.alpaka.build.id" + const val METADATA_KEY_BUILD_NUMBER = "ch.ubique.alpaka.build.number" + const val METADATA_KEY_BUILD_TIMESTAMP = "ch.ubique.alpaka.build.timestamp" + const val METADATA_KEY_BRANCH = "ch.ubique.alpaka.branch" + const val METADATA_KEY_FLAVOR = "ch.ubique.alpaka.flavor" } init { - group = "linth" + group = "alpaka" description = "Inject build metadata into Android manifest" } diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/task/UploadToLinthBackendTask.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/UploadToAlpakaBackendTask.kt similarity index 76% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/task/UploadToLinthBackendTask.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/UploadToAlpakaBackendTask.kt index 576b907..7673d1a 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/task/UploadToLinthBackendTask.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/task/UploadToAlpakaBackendTask.kt @@ -1,15 +1,15 @@ @file:Suppress("DEPRECATION") -package ch.ubique.gradle.linth.task - -import ch.ubique.gradle.linth.extensions.getMergedManifestFile -import ch.ubique.gradle.linth.extensions.getResDirs -import ch.ubique.gradle.linth.model.UploadRequest -import ch.ubique.gradle.linth.network.BackendRepository -import ch.ubique.gradle.linth.network.OkHttpInstance -import ch.ubique.gradle.linth.utils.GitUtils -import ch.ubique.gradle.linth.utils.SigningConfigUtils -import ch.ubique.gradle.linth.utils.StringUtils +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.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 @@ -21,11 +21,11 @@ import org.gradle.work.DisableCachingByDefault import retrofit2.HttpException @DisableCachingByDefault -abstract class UploadToLinthBackendTask : DefaultTask() { +abstract class UploadToAlpakaBackendTask : DefaultTask() { init { - group = "linth" - description = "Upload APK to the Ubique Linth backend" + group = "alpaka" + description = "Upload APK to the Ubique Alpaka backend" } @get:Input @@ -73,11 +73,11 @@ abstract class UploadToLinthBackendTask : DefaultTask() { signature = signature, ) - logger.lifecycle("Starting upload to Linth.") + logger.lifecycle("Starting upload to Alpaka.") try { val backendRepository = BackendRepository() backendRepository.appsUpload(uploadRequest = uploadRequest, uploadKey = uploadKey) - logger.lifecycle("Upload to Linth successful.") + logger.lifecycle("Upload to Alpaka successful.") } catch (e: Exception) { val message = if (e is HttpException) { e.response()?.run { @@ -86,7 +86,7 @@ abstract class UploadToLinthBackendTask : DefaultTask() { } else { null } ?: e.message - throw GradleException("Upload to Linth failed: $message", e) + throw GradleException("Upload to Alpaka failed: $message", e) } } diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/utils/GitUtils.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/GitUtils.kt similarity index 96% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/utils/GitUtils.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/GitUtils.kt index 38202e7..b4f078c 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/utils/GitUtils.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/GitUtils.kt @@ -1,4 +1,4 @@ -package ch.ubique.gradle.linth.utils +package ch.ubique.gradle.alpaka.utils import org.gradle.api.Project import java.io.BufferedReader diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/utils/IconUtils.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/IconUtils.kt similarity index 99% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/utils/IconUtils.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/IconUtils.kt index 0a56fa4..f17def3 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/utils/IconUtils.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/IconUtils.kt @@ -1,4 +1,4 @@ -package ch.ubique.gradle.linth.utils +package ch.ubique.gradle.alpaka.utils import java.awt.* import java.awt.geom.AffineTransform diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/utils/SigningConfigUtils.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/SigningConfigUtils.kt similarity index 98% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/utils/SigningConfigUtils.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/SigningConfigUtils.kt index bba79bb..a9e3c3e 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/utils/SigningConfigUtils.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/SigningConfigUtils.kt @@ -1,4 +1,4 @@ -package ch.ubique.gradle.linth.utils +package ch.ubique.gradle.alpaka.utils import com.android.builder.model.SigningConfig import org.gradle.api.logging.Logger diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/utils/StringUtils.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/StringUtils.kt similarity index 98% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/utils/StringUtils.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/StringUtils.kt index eeaaa53..a6e4a73 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/utils/StringUtils.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/StringUtils.kt @@ -1,4 +1,4 @@ -package ch.ubique.gradle.linth.utils +package ch.ubique.gradle.alpaka.utils import org.gradle.api.logging.Logger import java.io.File diff --git a/linth/plugin/src/main/java/ch/ubique/gradle/linth/utils/XmlParser.kt b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/XmlParser.kt similarity index 99% rename from linth/plugin/src/main/java/ch/ubique/gradle/linth/utils/XmlParser.kt rename to alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/XmlParser.kt index 5b61df3..3532ede 100644 --- a/linth/plugin/src/main/java/ch/ubique/gradle/linth/utils/XmlParser.kt +++ b/alpaka/plugin/src/main/java/ch/ubique/gradle/alpaka/utils/XmlParser.kt @@ -1,4 +1,4 @@ -package ch.ubique.gradle.linth.utils +package ch.ubique.gradle.alpaka.utils import org.w3c.dom.Document import org.w3c.dom.Element diff --git a/linth/plugin/src/test/java/ch/ubique/gradle/linth/LinthPluginTest.kt b/alpaka/plugin/src/test/java/ch/ubique/gradle/alpaka/AlpakaPluginTest.kt similarity index 87% rename from linth/plugin/src/test/java/ch/ubique/gradle/linth/LinthPluginTest.kt rename to alpaka/plugin/src/test/java/ch/ubique/gradle/alpaka/AlpakaPluginTest.kt index 5c6a174..dabf984 100644 --- a/linth/plugin/src/test/java/ch/ubique/gradle/linth/LinthPluginTest.kt +++ b/alpaka/plugin/src/test/java/ch/ubique/gradle/alpaka/AlpakaPluginTest.kt @@ -1,9 +1,9 @@ -package ch.ubique.gradle.linth +package ch.ubique.gradle.alpaka import org.junit.Test import java.io.File -class LinthPluginTest { +class AlpakaPluginTest { private val appExample: File = File("") @@ -26,7 +26,7 @@ class LinthPluginTest { fun `extension templateExampleConfig is created correctly`() { /* val project = ProjectBuilder.builder().build() - project.pluginManager.apply("ch.ubique.gradle.linth") + project.pluginManager.apply("ch.ubique.gradle.alpaka") assertNotNull(project.extensions.getByName("templateExampleConfig")) */ @@ -36,9 +36,9 @@ class LinthPluginTest { fun `parameters are passed correctly from extension to task`() { /* val project = ProjectBuilder.builder().build() - project.pluginManager.apply("ch.ubique.gradle.linth") + project.pluginManager.apply("ch.ubique.gradle.alpaka") val aFile = File(project.projectDir, ".tmp") - (project.extensions.getByName("templateExampleConfig") as LinthPluginConfig).apply { + (project.extensions.getByName("templateExampleConfig") as AlpakaPluginConfig).apply { tag.set("a-sample-tag") message.set("just-a-message") outputFile.set(aFile) diff --git a/linth/settings.gradle.kts b/alpaka/settings.gradle.kts similarity index 100% rename from linth/settings.gradle.kts rename to alpaka/settings.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts index 9ab800a..6acc0c0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,8 +13,8 @@ tasks.register("preMerge") { dependsOn(":examplekts:check") dependsOn(":examplegroovy:check") - dependsOn(gradle.includedBuild("linth").task(":plugin:check")) - dependsOn(gradle.includedBuild("linth").task(":plugin:validatePlugins")) + dependsOn(gradle.includedBuild("alpaka").task(":plugin:check")) + dependsOn(gradle.includedBuild("alpaka").task(":plugin:validatePlugins")) } tasks.wrapper { diff --git a/examplegroovy/build.gradle b/examplegroovy/build.gradle index dea3a61..934cd69 100644 --- a/examplegroovy/build.gradle +++ b/examplegroovy/build.gradle @@ -1,7 +1,7 @@ plugins { alias(libs.plugins.androidApplication) alias(libs.plugins.kotlinAndroid) - id("ch.ubique.gradle.linth") + id("ch.ubique.gradle.alpaka") } android { @@ -15,7 +15,7 @@ android { versionCode 1 versionName "1.0" - linthUploadKey = "defaultConfig upload key" + alpakaUploadKey = "defaultConfig upload key" } flavorDimensions = ["default"] @@ -24,7 +24,7 @@ android { dimension "default" applicationIdSuffix ".dev" - linthUploadKey = "dev flavor upload key" + alpakaUploadKey = "dev flavor upload key" launcherIconLabel = "develop" } prod { @@ -49,7 +49,7 @@ dependencies { implementation libs.androidx.constraintlayout } -linth { +alpaka { labelAppIcons = true changelogCommitCount = 5 } \ No newline at end of file diff --git a/examplekts/build.gradle.kts b/examplekts/build.gradle.kts index 754074f..05020e5 100644 --- a/examplekts/build.gradle.kts +++ b/examplekts/build.gradle.kts @@ -1,10 +1,10 @@ -import ch.ubique.gradle.linth.extensions.applicationvariant.launcherIconLabel -import ch.ubique.gradle.linth.extensions.applicationvariant.linthUploadKey +import ch.ubique.gradle.alpaka.extensions.applicationvariant.launcherIconLabel +import ch.ubique.gradle.alpaka.extensions.applicationvariant.alpakaUploadKey plugins { alias(libs.plugins.androidApplication) alias(libs.plugins.kotlinAndroid) - id("ch.ubique.gradle.linth") + id("ch.ubique.gradle.alpaka") } android { @@ -18,7 +18,7 @@ android { versionCode = 1 versionName = "1.0" - linthUploadKey = "defaultConfig upload key" + alpakaUploadKey = "defaultConfig upload key" } flavorDimensions += "default" @@ -27,7 +27,7 @@ android { dimension = "default" applicationIdSuffix = ".dev" - linthUploadKey = "dev flavor upload key" + alpakaUploadKey = "dev flavor upload key" launcherIconLabel = "develop" } create("prod") { @@ -52,7 +52,7 @@ dependencies { implementation(libs.activity) } -linth { +alpaka { labelAppIcons = true changelogCommitCount = 5 } \ No newline at end of file diff --git a/linth/gradle.properties b/linth/gradle.properties deleted file mode 100644 index db85b94..0000000 --- a/linth/gradle.properties +++ /dev/null @@ -1,10 +0,0 @@ -ID=ch.ubique.gradle.linth -GROUP=ch.ubique.gradle -ARTIFACT_ID=linth -# VERSION will only be used if no property "githubRefName" is set (which the release workflow does) -VERSION=0.0.0 -DISPLAY_NAME=Ubique Linth -DESCRIPTION=Adds tasks to apply flavor-specific icon overlays, inject build metadata into the Android manifest and upload the APK to the Ubique Linth backend -WEBSITE=https://github.com/UbiqueInnovation/gradle-plugin-linth-android -VCS_URL=https://github.com/UbiqueInnovation/gradle-plugin-linth-android -IMPLEMENTATION_CLASS=ch.ubique.gradle.linth.LinthPlugin diff --git a/settings.gradle.kts b/settings.gradle.kts index f388fe4..2f2b1a0 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -16,6 +16,6 @@ dependencyResolutionManagement { } } -includeBuild("linth") +includeBuild("alpaka") include(":examplekts") include(":examplegroovy")