fix: update group IDs for sub-modules; fixes gradle plugin test failures

This commit is contained in:
Akash Yadav
2024-07-01 15:06:35 +05:30
parent 1ed5f77dae
commit dab784af40
66 changed files with 257 additions and 281 deletions
+2 -3
View File
@@ -17,15 +17,14 @@ import com.itsaky.androidide.build.config.BuildConfig
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
@Suppress("JavaPluginLanguageLevel")
plugins {
id("java-library")
id("org.jetbrains.kotlin.jvm")
}
groupConfig {
groupIdSuffix.set("annotations")
}
dependencies {
implementation(libs.androidx.annotation)
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
@@ -23,9 +24,7 @@ plugins {
kotlin("kapt")
}
groupConfig {
groupIdSuffix.set("annotations")
}
dependencies {
kapt(libs.google.auto.service)
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.itsaky.androidide.build.config.BuildConfig
@@ -22,9 +23,7 @@ plugins {
kotlin("jvm")
}
groupConfig {
groupIdSuffix.set("annotations")
}
dependencies {
implementation(kotlin("stdlib"))
+11 -2
View File
@@ -21,7 +21,6 @@ import com.itsaky.androidide.build.config.BuildConfig
import com.itsaky.androidide.build.config.FDroidConfig
import com.itsaky.androidide.build.config.publishingVersion
import com.itsaky.androidide.plugins.AndroidIDEPlugin
import com.itsaky.androidide.plugins.GroupConfigPlugin
import com.itsaky.androidide.plugins.conf.configureAndroidModule
import com.itsaky.androidide.plugins.conf.configureJavaModule
import com.itsaky.androidide.plugins.conf.configureMavenPublish
@@ -47,11 +46,21 @@ buildscript {
}
}
// Root project has 'com.itsaky.androidide' as the group ID
project.group = BuildConfig.packageName
subprojects {
if (project != rootProject) {
var group = project.parent!!.group
if (project.parent != rootProject) {
group = "${group}.${project.parent!!.name}"
}
project.group = group
}
// Always load the F-Droid config
FDroidConfig.load(project)
apply { plugin(GroupConfigPlugin::class.java) }
afterEvaluate {
apply { plugin(AndroidIDEPlugin::class.java) }
}
@@ -1,42 +0,0 @@
/*
* This file is part of AndroidIDE.
*
* AndroidIDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AndroidIDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
package com.itsaky.androidide.plugins
import com.itsaky.androidide.build.config.BuildConfig
import com.itsaky.androidide.plugins.exts.GroupConfigPluginExtension.Companion.groupConfigExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
/**
* @author Akash Yadav
*/
class GroupConfigPlugin : Plugin<Project> {
override fun apply(target: Project) = target.run {
val extension = groupConfigExtension()
extension.groupIdSuffix.convention("")
afterEvaluate {
val suffix = extension.groupIdSuffix.get().let {
if (it.isNotEmpty()) ".${it}" else ""
}
project.group = "${BuildConfig.packageName}${suffix}"
logger.info("Maven group ID set to : ${project.group}")
}
}
}
@@ -18,6 +18,7 @@
package com.itsaky.androidide.plugins.conf
import com.itsaky.androidide.build.config.ProjectConfig
import com.itsaky.androidide.build.config.publishingVersion
import com.vanniktech.maven.publish.AndroidMultiVariantLibrary
import com.vanniktech.maven.publish.GradlePlugin
import com.vanniktech.maven.publish.JavaLibrary
@@ -32,7 +33,6 @@ import org.gradle.api.tasks.testing.Test
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.create
import org.gradle.kotlin.dsl.withType
import com.itsaky.androidide.build.config.publishingVersion
import java.io.File
private val projectsRequiringMavenLocalForTests = arrayOf(":tooling:plugin")
@@ -55,7 +55,8 @@ fun Project.configureMavenPublish() {
tasks.withType<Test> {
for ((project, _) in mavenLocalRepos) {
dependsOn(
project(project).tasks.getByName("publishAllPublicationsToBuildMavenLocalRepository"))
project(project).tasks.getByName("publishAllPublicationsToBuildMavenLocalRepository")
)
}
}
}
@@ -1,47 +0,0 @@
/*
* This file is part of AndroidIDE.
*
* AndroidIDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AndroidIDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
package com.itsaky.androidide.plugins.exts
import org.gradle.api.Project
import org.gradle.api.provider.Property
import org.gradle.kotlin.dsl.create
/**
* @author Akash Yadav
*/
abstract class GroupConfigPluginExtension {
/**
* The suffix for the maven group ID for the module.
*
* Example:
* If the [groupIdSuffix] is "core", then the maven group ID will be
* `${BuildConfig.packageName}.core`.
*/
abstract val groupIdSuffix: Property<String>
companion object {
/**
* Create the [GroupConfigPluginExtension] for the project.
*/
fun Project.groupConfigExtension(): GroupConfigPluginExtension {
return extensions.create<GroupConfigPluginExtension>("groupConfig")
}
}
}
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins{
@@ -23,9 +24,7 @@ plugins{
id("kotlin-kapt")
}
groupConfig {
groupIdSuffix.set("core")
}
android {
namespace = "${BuildConfig.packageName}.actions"
+19 -3
View File
@@ -1,9 +1,27 @@
/*
* This file is part of AndroidIDE.
*
* AndroidIDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AndroidIDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
@file:Suppress("UnstableApiUsage")
import com.itsaky.androidide.build.config.BuildConfig
import com.itsaky.androidide.desugaring.utils.JavaIOReplacements.applyJavaIOReplacements
import com.itsaky.androidide.plugins.AndroidIDEAssetsPlugin
plugins {
id("com.itsaky.androidide.core-app")
id("com.android.application")
@@ -26,9 +44,7 @@ buildscript {
}
}
groupConfig {
groupIdSuffix.set("core")
}
android {
namespace = BuildConfig.packageName
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -22,9 +23,7 @@ plugins {
id("kotlin-android")
}
groupConfig {
groupIdSuffix.set("core")
}
android {
namespace = "${BuildConfig.packageName}.common"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -24,9 +25,7 @@ plugins {
id("realm-android")
}
groupConfig {
groupIdSuffix.set("core")
}
android {
namespace = "${BuildConfig.packageName}.database"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -24,9 +25,7 @@ plugins {
id("realm-android")
}
groupConfig {
groupIdSuffix.set("core")
}
android {
namespace = "${BuildConfig.packageName}.indexing.api"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -24,9 +25,7 @@ plugins {
id("realm-android")
}
groupConfig {
groupIdSuffix.set("core")
}
android {
namespace = "${BuildConfig.packageName}.indexing.core"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -23,9 +24,7 @@ plugins {
id("kotlin-kapt")
}
groupConfig {
groupIdSuffix.set("core")
}
android {
namespace = "${BuildConfig.packageName}.lsp.api"
+19 -3
View File
@@ -1,13 +1,29 @@
/*
* This file is part of AndroidIDE.
*
* AndroidIDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AndroidIDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
id("com.android.library")
id("kotlin-android")
}
groupConfig {
groupIdSuffix.set("core")
}
android {
namespace = "${BuildConfig.packageName}.lsp.models"
+19 -3
View File
@@ -1,5 +1,23 @@
/*
* This file is part of AndroidIDE.
*
* AndroidIDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AndroidIDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
id("com.android.library")
id("kotlin-android")
@@ -7,9 +25,7 @@ plugins {
id("kotlin-kapt")
}
groupConfig {
groupIdSuffix.set("core")
}
android {
namespace = "${BuildConfig.packageName}.projects"
+2 -3
View File
@@ -15,15 +15,14 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
id("com.android.library")
}
groupConfig {
groupIdSuffix.set("core")
}
android {
namespace = "${BuildConfig.packageName}.resources"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -22,9 +23,7 @@ plugins {
id("kotlin-android")
}
groupConfig {
groupIdSuffix.set("core")
}
android {
namespace = "${BuildConfig.packageName}.editor.api"
+19 -3
View File
@@ -1,5 +1,23 @@
/*
* This file is part of AndroidIDE.
*
* AndroidIDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AndroidIDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
id("com.android.library")
id("kotlin-android")
@@ -7,9 +25,7 @@ plugins {
id("com.google.devtools.ksp") version libs.versions.ksp
}
groupConfig {
groupIdSuffix.set("core")
}
android {
namespace = "${BuildConfig.packageName}.editor"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.plugins.LexerGeneratorPlugin
import com.itsaky.androidide.build.config.BuildConfig
@@ -27,9 +28,7 @@ apply {
plugin(LexerGeneratorPlugin::class.java)
}
groupConfig {
groupIdSuffix.set("core")
}
java {
sourceCompatibility = BuildConfig.javaVersion
+2 -3
View File
@@ -22,14 +22,13 @@
* additional information or have any questions
******************************************************************************/
plugins {
id("com.android.library")
id("kotlin-android")
}
groupConfig {
groupIdSuffix.set("core")
}
android {
namespace = "io.github.rosemoe.sora.ts"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -22,9 +23,7 @@ plugins {
id("org.jetbrains.kotlin.android")
}
groupConfig {
groupIdSuffix.set("event")
}
android {
namespace = "${BuildConfig.packageName}.eventbus.android"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -22,9 +23,7 @@ plugins {
id("kotlin-android")
}
groupConfig {
groupIdSuffix.set("event")
}
android {
namespace = "${BuildConfig.packageName}.eventbus.events"
+2 -3
View File
@@ -15,15 +15,14 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
@Suppress("JavaPluginLanguageLevel")
plugins {
id("java-library")
id("org.jetbrains.kotlin.jvm")
}
groupConfig {
groupIdSuffix.set("event")
}
dependencies {
implementation(libs.common.jkotlin)
+19 -3
View File
@@ -1,13 +1,29 @@
/*
* This file is part of AndroidIDE.
*
* AndroidIDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AndroidIDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
id("com.android.library")
id("kotlin-android")
}
groupConfig {
groupIdSuffix.set("java")
}
android {
namespace = "${BuildConfig.packageName}.javac.services"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -24,9 +25,7 @@ plugins {
id("realm-android")
}
groupConfig {
groupIdSuffix.set("event")
}
android {
namespace = "${BuildConfig.packageName}.lsp.java"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -22,9 +23,7 @@ plugins {
id("org.jetbrains.kotlin.android")
}
groupConfig {
groupIdSuffix.set("logging")
}
android {
namespace = "${BuildConfig.packageName}.stats"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.plugins.NoDesugarPlugin
@Suppress("JavaPluginLanguageLevel")
@@ -27,9 +28,7 @@ apply {
plugin(NoDesugarPlugin::class.java)
}
groupConfig {
groupIdSuffix.set("logging")
}
description = "AndroidIDE Logging Framework"
+2 -3
View File
@@ -15,15 +15,14 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
id("com.android.application")
}
groupConfig {
groupIdSuffix.set("logging")
}
android {
namespace = "${BuildConfig.packageName}.logsender.sample"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.plugins.NoDesugarPlugin
import com.itsaky.androidide.build.config.BuildConfig
@@ -27,9 +28,7 @@ apply {
plugin(NoDesugarPlugin::class.java)
}
groupConfig {
groupIdSuffix.set("logging")
}
description = "LogSender is used to read logs from applications built with AndroidIDE"
+3 -3
View File
@@ -17,6 +17,8 @@
@file:Suppress("UnstableApiUsage")
import com.itsaky.androidide.build.config.BuildConfig
import com.itsaky.androidide.plugins.TerminalBootstrapPackagesPlugin
@@ -29,9 +31,7 @@ apply {
plugin(TerminalBootstrapPackagesPlugin::class.java)
}
groupConfig {
groupIdSuffix.set("termux")
}
val packageVariant = System.getenv("TERMUX_PACKAGE_VARIANT") ?: "apt-android-7" // Default: "apt-android-7"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -22,9 +23,7 @@ plugins {
id("kotlin-android")
}
groupConfig {
groupIdSuffix.set("emulator")
}
android {
namespace = "com.termux.emulator"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -22,9 +23,7 @@ plugins {
id("kotlin-android")
}
groupConfig {
groupIdSuffix.set("termux")
}
android {
namespace = "com.termux.shared"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -22,9 +23,7 @@ plugins {
id("kotlin-android")
}
groupConfig {
groupIdSuffix.set("termux")
}
android {
namespace = "com.termux.view"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -22,9 +23,7 @@ plugins {
id("kotlin-android")
}
groupConfig {
groupIdSuffix.set("testing")
}
android {
namespace = "${BuildConfig.packageName}.testing.android"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -23,9 +24,7 @@ plugins {
alias(libs.plugins.benchmark)
}
groupConfig {
groupIdSuffix.set("testing")
}
android {
namespace = "${BuildConfig.packageName}.benchmark"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
@Suppress("JavaPluginLanguageLevel")
plugins {
id("java-library")
@@ -22,9 +23,7 @@ plugins {
id("org.jetbrains.kotlin.jvm")
}
groupConfig {
groupIdSuffix.set("testing")
}
dependencies {
kapt(libs.google.auto.service)
+2 -3
View File
@@ -15,15 +15,14 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
@Suppress("JavaPluginLanguageLevel")
plugins {
id("java-library")
id("org.jetbrains.kotlin.jvm")
}
groupConfig {
groupIdSuffix.set("testing")
}
dependencies {
api(libs.common.jkotlin)
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -22,9 +23,7 @@ plugins {
id("kotlin-android")
}
groupConfig {
groupIdSuffix.set("testing")
}
android {
namespace = "${BuildConfig.packageName}.lsp.testing"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -22,9 +23,7 @@ plugins {
kotlin("android")
}
groupConfig {
groupIdSuffix.set("testing")
}
android {
namespace = "${BuildConfig.packageName}.testing.unit"
+2 -3
View File
@@ -15,15 +15,14 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
@Suppress("JavaPluginLanguageLevel")
plugins {
id("java-library")
id("org.jetbrains.kotlin.jvm")
}
groupConfig {
groupIdSuffix.set("tooling")
}
dependencies {
api(projects.logging.logger)
+2 -3
View File
@@ -15,15 +15,14 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
@Suppress("JavaPluginLanguageLevel")
plugins {
id("java-library")
id("org.jetbrains.kotlin.jvm")
}
groupConfig {
groupIdSuffix.set("tooling")
}
dependencies {
api(libs.tooling.builderModel)
+2 -3
View File
@@ -15,15 +15,14 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
@Suppress("JavaPluginLanguageLevel")
plugins {
id("java-library")
id("org.jetbrains.kotlin.jvm")
}
groupConfig {
groupIdSuffix.set("tooling")
}
dependencies {
implementation(libs.common.jkotlin)
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
@Suppress("JavaPluginLanguageLevel")
@@ -25,9 +26,7 @@ plugins {
id("org.jetbrains.kotlin.jvm")
}
groupConfig {
groupIdSuffix.set("tooling")
}
tasks.withType<Jar> {
manifest { attributes("Main-Class" to "${BuildConfig.packageName}.tooling.impl.Main") }
+2 -3
View File
@@ -15,15 +15,14 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
@Suppress("JavaPluginLanguageLevel")
plugins {
id ("java-library")
id ("org.jetbrains.kotlin.jvm")
}
groupConfig {
groupIdSuffix.set("tooling")
}
dependencies {
+2 -3
View File
@@ -15,14 +15,13 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
plugins {
//noinspection JavaPluginLanguageLevel
id("java-library")
id("com.vanniktech.maven.publish.base")
}
groupConfig {
groupIdSuffix.set("tooling")
}
description = "Configuration options for the Tooling API and Gradle Plugin."
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.AGP_VERSION_MINIMUM
import com.itsaky.androidide.build.config.BuildConfig
import com.itsaky.androidide.build.config.ProjectConfig
@@ -25,9 +26,7 @@ plugins {
id("com.vanniktech.maven.publish.base")
}
groupConfig {
groupIdSuffix.set("tooling")
}
description = "Gradle Plugin for projects that are built with AndroidIDE"
@@ -51,7 +51,7 @@ class AndroidIDEInitScriptPlugin : Plugin<Gradle> {
target.rootProject { rootProject ->
rootProject.buildscript.apply {
dependencies.apply {
val gradlePluginDep = rootProject.ideDependency("gradle-plugin")
val gradlePluginDep = rootProject.ideDependency(LIB_GROUP_TOOLING, "plugin")
if (gradlePluginDep is ExternalModuleDependency) {
// SNAPSHOT versions of gradle-plugin do not change
gradlePluginDep.isChanging = false
@@ -108,7 +108,7 @@ class AndroidIDEInitScriptPlugin : Plugin<Gradle> {
private fun getTestEnvProps(startParameter: StartParameter): Pair<Boolean, String> {
return startParameter.run {
val isTestEnv = projectProperties.containsKey(_PROPERTY_IS_TEST_ENV)
&& projectProperties[_PROPERTY_IS_TEST_ENV].toString().toBoolean()
&& projectProperties[_PROPERTY_IS_TEST_ENV].toString().toBoolean()
val mavenLocalRepos = projectProperties.getOrDefault(_PROPERTY_MAVEN_LOCAL_REPOSITORY, "")
isTestEnv to mavenLocalRepos
@@ -81,7 +81,10 @@ class LogSenderPlugin : Plugin<Project> {
variant.withRuntimeConfiguration {
val logsenderDependency = project.dependencies.ideDependency(
LOGSENDER_DEPENDENCY_ARTIFACT, project.isTestEnv)
LIB_GROUP_LOGGING,
LOGSENDER_DEPENDENCY_ARTIFACT,
project.isTestEnv
)
if (logsenderDependency is ExternalModuleDependency) {
// a new snapshot is published for each build
@@ -30,6 +30,9 @@ import org.gradle.api.artifacts.dsl.DependencyHandler
const val APP_PLUGIN = "com.android.application"
const val LIBRARY_PLUGIN = "com.android.library"
const val LIB_GROUP_LOGGING = "logging"
const val LIB_GROUP_TOOLING = "tooling"
internal val Project.isTestEnv: Boolean
get() = hasProperty(_PROPERTY_IS_TEST_ENV) && property(
_PROPERTY_IS_TEST_ENV).toString().toBoolean()
@@ -42,10 +45,10 @@ internal fun depVersion(testEnv: Boolean): String {
}
}
fun Project.ideDependency(artifact: String): Dependency {
return dependencies.ideDependency(artifact, isTestEnv)
fun Project.ideDependency(group: String, artifact: String): Dependency {
return dependencies.ideDependency(group, artifact, isTestEnv)
}
fun DependencyHandler.ideDependency(artifact: String, testEnv: Boolean): Dependency {
return create("${BuildInfo.MVN_GROUP_ID}:${artifact}:${depVersion(testEnv)}")
fun DependencyHandler.ideDependency(group: String, artifact: String, testEnv: Boolean): Dependency {
return create("${BuildInfo.MVN_GROUP_ID}.${group}:${artifact}:${depVersion(testEnv)}")
}
@@ -69,8 +69,10 @@ internal fun buildProject(
*args.toTypedArray()
)
writeInitScript(initScript.toFile(),
PluginUnderTestMetadataReading.readImplementationClasspath())
writeInitScript(
initScript.toFile(),
PluginUnderTestMetadataReading.readImplementationClasspath()
)
return runner.build()
}
@@ -81,12 +83,12 @@ internal fun writeInitScript(file: File, deps: List<File>) {
val root = FileProvider.projectRoot().pathString
val depsString = deps.filter { it.absolutePath.startsWith(root) }
.joinToString(separator = System.lineSeparator()) {
val isDir = it.isDirectory
"classpath ${if (isDir) "files" else "files"}(\"${it}\")"
"classpath files(\"${it}\")"
}
file.bufferedWriter().use {
it.write("""
it.write(
"""
initscript {
dependencies {
// make sure the init script plugin is in classpath
@@ -95,7 +97,8 @@ internal fun writeInitScript(file: File, deps: List<File>) {
}
apply plugin: com.itsaky.androidide.gradle.AndroidIDEInitScriptPlugin
""".trimIndent())
""".trimIndent()
)
}
}
@@ -125,7 +128,8 @@ internal fun openProject(
plugins.joinToString(separator = "\n") { "apply plugin: \"$it\"" }
}
projectRoot.resolve("app/build.gradle" + if (useApplyPluginGroovySyntax) "" else ".kts").toFile()
projectRoot.resolve("app/build.gradle" + if (useApplyPluginGroovySyntax) "" else ".kts")
.toFile()
.replaceAllPlaceholders(mapOf("PLUGINS" to pluginsText))
}
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.android.SdkConstants
import com.itsaky.androidide.build.config.AGP_VERSION_MINIMUM
import com.itsaky.androidide.build.config.BuildConfig
@@ -34,9 +35,7 @@ plugins {
id("com.vanniktech.maven.publish.base")
}
groupConfig {
groupIdSuffix.set("utils")
}
description = "Information about the AndroidIDE build"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -22,9 +23,7 @@ plugins {
id("kotlin-android")
}
groupConfig {
groupIdSuffix.set("utils")
}
android {
namespace = "${BuildConfig.packageName}.flashbar"
+2 -3
View File
@@ -15,14 +15,13 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
@Suppress("JavaPluginLanguageLevel")
plugins {
id("java-library")
}
groupConfig {
groupIdSuffix.set("utils")
}
dependencies {
compileOnlyApi(files ("libs/android.jar"))
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
@Suppress("JavaPluginLanguageLevel")
plugins {
id("java-library")
@@ -22,9 +23,7 @@ plugins {
id("kotlin-kapt")
}
groupConfig {
groupIdSuffix.set("utils")
}
dependencies {
kapt(libs.google.auto.service)
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -23,9 +24,7 @@ plugins {
id("kotlin-parcelize")
}
groupConfig {
groupIdSuffix.set("utils")
}
android {
namespace = "${BuildConfig.packageName}.preferences"
+2 -3
View File
@@ -15,15 +15,14 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
@Suppress("JavaPluginLanguageLevel")
plugins {
id("java-library")
id("org.jetbrains.kotlin.jvm")
}
groupConfig {
groupIdSuffix.set("utils")
}
dependencies {
implementation(libs.androidx.annotation)
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -22,9 +23,7 @@ plugins {
id("org.jetbrains.kotlin.android")
}
groupConfig {
groupIdSuffix.set("utils")
}
android {
namespace = "${BuildConfig.packageName}.templates"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -23,9 +24,7 @@ plugins {
id("kotlin-kapt")
}
groupConfig {
groupIdSuffix.set("utils")
}
android {
namespace = "${BuildConfig.packageName}.templates.impl"
+2 -3
View File
@@ -15,11 +15,10 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
plugins { id("com.android.library") }
groupConfig {
groupIdSuffix.set("utils")
}
android { namespace = "com.unnamed.b.atv" }
+19 -3
View File
@@ -1,3 +1,21 @@
/*
* This file is part of AndroidIDE.
*
* AndroidIDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AndroidIDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -6,9 +24,7 @@ plugins {
id("kotlin-parcelize")
}
groupConfig {
groupIdSuffix.set("utils")
}
android {
namespace = "${BuildConfig.packageName}.uidesigner"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -24,9 +25,7 @@ plugins {
id("com.google.devtools.ksp") version libs.versions.ksp
}
groupConfig {
groupIdSuffix.set("utils")
}
android { namespace = "${BuildConfig.packageName}.inflater" }
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.google.protobuf.gradle.id
import com.itsaky.androidide.build.config.BuildConfig
@@ -24,9 +25,7 @@ plugins {
id("com.google.protobuf")
}
groupConfig {
groupIdSuffix.set("xml")
}
android {
namespace = "${BuildConfig.packageName}.aaptcompiler"
+2 -3
View File
@@ -15,15 +15,14 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
@Suppress("JavaPluginLanguageLevel")
plugins {
id("java-library")
id("org.jetbrains.kotlin.jvm")
}
groupConfig {
groupIdSuffix.set("xml")
}
dependencies {
implementation(projects.utilities.shared)
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -23,9 +24,7 @@ plugins {
id("kotlin-kapt")
}
groupConfig {
groupIdSuffix.set("xml")
}
android {
namespace = "${BuildConfig.packageName}.lsp.xml"
+2 -3
View File
@@ -15,6 +15,7 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import com.itsaky.androidide.build.config.BuildConfig
plugins {
@@ -23,9 +24,7 @@ plugins {
id("kotlin-kapt")
}
groupConfig {
groupIdSuffix.set("xml")
}
android {
namespace = "${BuildConfig.packageName}.xml"