diff --git a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/AndroidIDEInitScriptPlugin.kt b/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/AndroidIDEInitScriptPlugin.kt index 975b1d535..b6bab5eb8 100644 --- a/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/AndroidIDEInitScriptPlugin.kt +++ b/gradle-plugin/src/main/java/com/itsaky/androidide/gradle/AndroidIDEInitScriptPlugin.kt @@ -115,5 +115,6 @@ class AndroidIDEInitScriptPlugin : Plugin { google() mavenCentral() + gradlePluginPortal() } } \ No newline at end of file diff --git a/gradle-plugin/src/test/resources/sample-project/build-logic/.gitignore b/gradle-plugin/src/test/resources/sample-project/build-logic/.gitignore new file mode 100644 index 000000000..42afabfd2 --- /dev/null +++ b/gradle-plugin/src/test/resources/sample-project/build-logic/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/gradle-plugin/src/test/resources/sample-project/build-logic/gradle.properties b/gradle-plugin/src/test/resources/sample-project/build-logic/gradle.properties new file mode 100644 index 000000000..13a405a54 --- /dev/null +++ b/gradle-plugin/src/test/resources/sample-project/build-logic/gradle.properties @@ -0,0 +1,20 @@ +# +# 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 . +# + +org.gradle.parallel=true +org.gradle.caching=true +org.gradle.configureondemand=true \ No newline at end of file diff --git a/gradle-plugin/src/test/resources/sample-project/build-logic/gradle/wrapper/gradle-wrapper.jar b/gradle-plugin/src/test/resources/sample-project/build-logic/gradle/wrapper/gradle-wrapper.jar new file mode 100755 index 000000000..41d9927a4 Binary files /dev/null and b/gradle-plugin/src/test/resources/sample-project/build-logic/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle-plugin/src/test/resources/sample-project/build-logic/gradle/wrapper/gradle-wrapper.properties b/gradle-plugin/src/test/resources/sample-project/build-logic/gradle/wrapper/gradle-wrapper.properties new file mode 100755 index 000000000..db9a6b825 --- /dev/null +++ b/gradle-plugin/src/test/resources/sample-project/build-logic/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradle-plugin/src/test/resources/sample-project/build-logic/ide/.gitignore b/gradle-plugin/src/test/resources/sample-project/build-logic/ide/.gitignore new file mode 100644 index 000000000..796b96d1c --- /dev/null +++ b/gradle-plugin/src/test/resources/sample-project/build-logic/ide/.gitignore @@ -0,0 +1 @@ +/build diff --git a/gradle-plugin/src/test/resources/sample-project/build-logic/ide/build.gradle.kts b/gradle-plugin/src/test/resources/sample-project/build-logic/ide/build.gradle.kts new file mode 100644 index 000000000..4f023a965 --- /dev/null +++ b/gradle-plugin/src/test/resources/sample-project/build-logic/ide/build.gradle.kts @@ -0,0 +1,41 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +/* + * 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 . + */ + +plugins { + `kotlin-dsl` +} + +repositories { + google() + gradlePluginPortal() + mavenCentral() +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} + +tasks.withType { + kotlinOptions.jvmTarget = "17" +} + +dependencies { + implementation(gradleApi()) +} diff --git a/gradle-plugin/src/test/resources/sample-project/build-logic/ide/src/main/java/build-logic.root-project.gradle.kts b/gradle-plugin/src/test/resources/sample-project/build-logic/ide/src/main/java/build-logic.root-project.gradle.kts new file mode 100644 index 000000000..3c495b263 --- /dev/null +++ b/gradle-plugin/src/test/resources/sample-project/build-logic/ide/src/main/java/build-logic.root-project.gradle.kts @@ -0,0 +1,20 @@ +/* + * 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 . + */ + +require(project == rootProject) { + "This script must be apply to the root project." +} \ No newline at end of file diff --git a/gradle-plugin/src/test/resources/sample-project/build-logic/settings.gradle.kts b/gradle-plugin/src/test/resources/sample-project/build-logic/settings.gradle.kts new file mode 100644 index 000000000..82bf41327 --- /dev/null +++ b/gradle-plugin/src/test/resources/sample-project/build-logic/settings.gradle.kts @@ -0,0 +1,32 @@ +/* + * 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 . + */ + + +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") + +dependencyResolutionManagement { + repositories { + google() + mavenCentral() + } +} + +include( + ":ide" +) + +rootProject.name = "build-logic" \ No newline at end of file