build: reorganize modules to fix dependency resolution issues

This commit is contained in:
Akash Yadav
2024-05-28 22:54:49 +05:30
parent 255d8e9c27
commit c0c185cfb7
60 changed files with 81 additions and 68 deletions
+10
View File
@@ -153,10 +153,20 @@
<module name="AndroidIDE.templates-testing.main" target="11" />
<module name="AndroidIDE.templates-testing.test" target="11" />
<module name="AndroidIDE.testing-android" target="17" />
<module name="AndroidIDE.testing.android" target="17" />
<module name="AndroidIDE.testing.android.test" target="11" />
<module name="AndroidIDE.testing.benchmark" target="17" />
<module name="AndroidIDE.testing.common" target="11" />
<module name="AndroidIDE.testing.common.main" target="11" />
<module name="AndroidIDE.testing.common.test" target="11" />
<module name="AndroidIDE.testing.lsp" target="17" />
<module name="AndroidIDE.testing.tooling" target="11" />
<module name="AndroidIDE.testing.tooling-api" target="11" />
<module name="AndroidIDE.testing.tooling-api.main" target="11" />
<module name="AndroidIDE.testing.tooling-api.test" target="11" />
<module name="AndroidIDE.testing.tooling.main" target="11" />
<module name="AndroidIDE.testing.tooling.test" target="11" />
<module name="AndroidIDE.testing.unit" target="17" />
<module name="AndroidIDE.testing.unit.test" target="11" />
<module name="AndroidIDE.treesitter.test" target="1.7" />
<module name="ATS.android-tree-sitter" target="17" />
+2 -2
View File
@@ -158,6 +158,6 @@ dependencies {
// So we always copy the latest JAR file to assets
compileOnly(projects.subprojects.toolingApiImpl)
testImplementation(projects.testing.unit)
androidTestImplementation(projects.testing.android)
testImplementation(projects.subprojects.testingUnit)
androidTestImplementation(projects.subprojects.testingAndroid)
}
+2 -1
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
import com.itsaky.androidide.build.config.CI
@@ -74,7 +75,7 @@ tasks.create("generateBuildInfo") {
"AGP_VERSION_MININUM" to AGP_VERSION_MINIMUM,
"AGP_VERSION_LATEST" to libs.versions.agp.tooling.get(),
"AGP_VERSION_GRADLE_LATEST" to "8.6" /*SdkConstants.GRADLE_LATEST_VERSION*/,
"AGP_VERSION_GRADLE_LATEST" to SdkConstants.GRADLE_LATEST_VERSION,
"SNAPSHOTS_REPOSITORY" to VersionUtils.SONATYPE_SNAPSHOTS_REPO,
"PUBLIC_REPOSITORY" to VersionUtils.SONATYPE_PUBLIC_REPO,
+2 -2
View File
@@ -18,8 +18,8 @@
import com.itsaky.androidide.build.config.BuildConfig
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
id("com.android.library")
id("kotlin-android")
}
android {
@@ -1,6 +1,6 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
id("com.android.library")
id("kotlin-android")
id("com.itsaky.androidide.build")
}
@@ -15,6 +15,10 @@
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
plugins {
alias(libs.plugins.kotlin.jvm) apply false
}
subprojects {
plugins.withId("java-library") {
extensions.getByType(JavaPluginExtension::class.java).apply {
@@ -20,7 +20,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
//noinspection JavaPluginLanguageLevel
id("java-library")
alias(libs.plugins.kotlin.jvm)
id("org.jetbrains.kotlin.jvm")
}
tasks.withType<KotlinCompile> {
@@ -46,20 +46,22 @@ class TerminalBootstrapPackagesPlugin : Plugin<Project> {
*/
private const val BOOTSTRAP_PACKAGES_VERSION = "16.12.2023"
private const val PACKAGES_DOWNLOAD_URL = "https://github.com/AndroidIDEOfficial/terminal-packages/releases/download/bootstrap-%1\$s/bootstrap-%2\$s.zip"
private const val PACKAGES_DOWNLOAD_URL =
"https://github.com/AndroidIDEOfficial/terminal-packages/releases/download/bootstrap-%1\$s/bootstrap-%2\$s.zip"
}
override fun apply(target: Project) {
target.run {
val bootstrapOut = project.layout.buildDirectory.file("intermediates/bootstrap-packages")
val bootstrapOut = project.layout.buildDirectory.dir("bootstrap-packages")
.get().asFile
val files = BOOTSTRAP_PACKAGES.map { (arch, sha256) ->
val file = File(bootstrapOut, "bootstrap-${arch}.zip")
file.parentFile.mkdirs()
DownloadUtils.doDownload(file = file,
DownloadUtils.doDownload(
file = file,
remoteUrl = PACKAGES_DOWNLOAD_URL.format(BOOTSTRAP_PACKAGES_VERSION, arch),
expectedChecksum = sha256,
logger = logger
+2 -2
View File
@@ -1,6 +1,6 @@
[versions]
agp = "8.3.0"
agp-tooling = "8.4.0-rc02"
agp = "8.4.1"
agp-tooling = "8.4.1"
gradle-tooling = "8.6"
junit-jupiter = "5.10.2"
kotlin = "1.9.24"
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+10 -10
View File
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
+8 -9
View File
@@ -45,18 +45,17 @@ dependencies {
implementation(libs.androidide.ts)
implementation(libs.androidide.ts.java)
implementation(libs.androidx.appcompat)
implementation(libs.common.editor)
implementation(libs.common.javaparser)
implementation(libs.common.utilcode)
implementation(libs.androidx.annotation)
implementation(libs.google.guava)
implementation(libs.google.gson)
implementation(libs.google.material)
compileOnly(libs.androidx.appcompat)
compileOnly(libs.google.material)
compileOnly(projects.actions)
compileOnly(projects.common)
implementation(projects.actions)
implementation(projects.common)
implementation(projects.editorApi)
implementation(projects.resources)
implementation(projects.lsp.api)
@@ -71,10 +70,10 @@ dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.common.kotlin)
testImplementation(projects.testing.common)
testImplementation(projects.testing.lsp)
androidTestImplementation(projects.testing.android)
testImplementation(projects.subprojects.testingCommon)
testImplementation(projects.subprojects.testingLsp)
androidTestImplementation(projects.subprojects.testingAndroid)
androidTestImplementation(projects.common)
androidTestImplementation(projects.shared)
}
+2 -1
View File
@@ -55,7 +55,8 @@ dependencies {
testImplementation(projects.actions)
testImplementation(projects.subprojects.projects)
testImplementation(projects.subprojects.toolingApi)
testImplementation(projects.testing.lsp)
testImplementation(projects.subprojects.testingCommon)
testImplementation(projects.subprojects.testingLsp)
compileOnly(projects.common)
compileOnly(libs.common.antlr4)
+6 -6
View File
@@ -160,6 +160,12 @@ include(
":subprojects:indexing",
":subprojects:javac-services",
":subprojects:projects",
":subprojects:testing-android",
":subprojects:testing-benchmarks",
":subprojects:testing-common",
":subprojects:testing-lsp",
":subprojects:testing-tooling",
":subprojects:testing-unit",
":subprojects:tooling-api",
":subprojects:tooling-api-events",
":subprojects:tooling-api-impl",
@@ -170,12 +176,6 @@ include(
":termux:termux-emulator",
":termux:termux-shared",
":termux:termux-view",
":testing:android",
":testing:benchmark",
":testing:common",
":testing:lsp",
":testing:tooling",
":testing:unit",
)
object FDroidConfig {
+1 -1
View File
@@ -38,5 +38,5 @@ dependencies {
implementation(libs.google.auto.service.annotations)
implementation(libs.google.guava)
testImplementation(projects.testing.tooling)
testImplementation(projects.subprojects.testingTooling)
}
@@ -18,8 +18,8 @@
import com.itsaky.androidide.build.config.BuildConfig
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
id("com.android.library")
id("kotlin-android")
}
android {
@@ -61,5 +61,5 @@ dependencies {
api(projects.buildInfo)
api(projects.common)
api(projects.shared)
api(projects.testing.common)
api(projects.subprojects.testingCommon)
}
@@ -24,10 +24,10 @@ plugins {
dependencies {
kapt(libs.google.auto.service)
implementation(libs.google.auto.service.annotations)
api(libs.google.auto.service.annotations)
api(libs.tests.junit)
api(projects.logger)
implementation(projects.subprojects.toolingApiImpl)
api(projects.subprojects.toolingApiImpl)
}
@@ -18,8 +18,8 @@
import com.itsaky.androidide.build.config.BuildConfig
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
id("com.android.library")
id("kotlin-android")
}
android {
@@ -30,15 +30,14 @@ dependencies {
api(libs.androidx.core.ktx)
api(libs.common.editor)
api(libs.common.kotlin)
api(libs.tests.mockito.kotlin)
api(projects.actions)
api(projects.common)
api(projects.eventbusAndroid)
api(projects.lsp.api)
api(projects.testing.common)
api(projects.testing.android)
api(projects.testing.tooling)
api(projects.testing.unit)
api(projects.subprojects.testingCommon)
api(projects.subprojects.testingAndroid)
api(projects.subprojects.testingTooling)
api(projects.subprojects.testingUnit)
}
@@ -27,13 +27,11 @@ dependencies {
api(libs.tests.junit)
api(libs.tests.google.truth)
api(libs.tests.mockk)
api(projects.buildInfo)
api(projects.logger)
api(projects.shared)
api(projects.subprojects.toolingApi)
api(projects.testing.common)
api(projects.subprojects.testingCommon)
// build tooling API before tests
compileOnly(projects.subprojects.toolingApiImpl)
@@ -32,10 +32,8 @@ dependencies {
api(libs.tests.junit)
api(libs.tests.google.truth)
api(libs.tests.mockk)
api(projects.buildInfo)
api(projects.common)
api(projects.shared)
api(projects.testing.common)
api(projects.subprojects.testingCommon)
}
@@ -71,7 +71,7 @@ dependencies {
implementation(libs.xml.apis)
implementation(libs.tooling.gradleApi)
testImplementation(projects.testing.tooling)
testImplementation(projects.subprojects.testingTooling)
runtimeOnly(libs.tooling.slf4j)
}
+2 -2
View File
@@ -43,6 +43,6 @@ dependencies {
testImplementation(projects.templatesApi)
testImplementation(projects.lsp.api)
testImplementation(projects.preferences)
testImplementation(projects.testing.unit)
testImplementation(projects.testing.tooling)
testImplementation(projects.subprojects.testingUnit)
testImplementation(projects.subprojects.testingTooling)
}
+1 -1
View File
@@ -68,7 +68,7 @@ dependencies {
implementation(projects.termux.termuxView)
implementation(projects.termux.termuxShared)
testImplementation(projects.testing.unit)
testImplementation(projects.subprojects.testingUnit)
}
tasks.register("versionName") {
+1 -1
View File
@@ -36,5 +36,5 @@ tasks.withType(Test::class.java) {
dependencies {
implementation(libs.androidx.annotation)
testImplementation(projects.testing.unit)
testImplementation(projects.subprojects.testingUnit)
}
+2 -2
View File
@@ -40,6 +40,6 @@ dependencies {
implementation(projects.preferences)
implementation(projects.resources)
testImplementation(projects.testing.unit)
testImplementation(projects.testing.android)
testImplementation(projects.subprojects.testingUnit)
testImplementation(projects.subprojects.testingAndroid)
}
+1 -1
View File
@@ -15,5 +15,5 @@ dependencies {
implementation(projects.resources)
api(projects.termux.termuxEmulator)
testImplementation(projects.testing.unit)
testImplementation(projects.subprojects.testingUnit)
}
+2 -1
View File
@@ -41,5 +41,6 @@ dependencies {
implementation(projects.resources)
testImplementation(projects.subprojects.projects)
testImplementation(projects.testing.tooling)
testImplementation(projects.subprojects.testingCommon)
testImplementation(projects.subprojects.testingTooling)
}