File tree Expand file tree Collapse file tree
objectbox-gradle-plugin/src
main/kotlin/io/objectbox/gradle
test/kotlin/io/objectbox/gradle Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,9 +48,10 @@ import org.gradle.api.tasks.compile.JavaCompile
4848open class ObjectBoxGradlePlugin : Plugin <Project > {
4949
5050 /* *
51- * The Gradle plugin id as registered in resources/META-INF/gradle-plugins.
51+ * The Gradle plugin id as registered in resources/META-INF/gradle-plugins (but actually configured using the
52+ * Gradle plugin development plugin in the build script using the gradlePlugin extension).
5253 */
53- internal open val pluginId = " io.objectbox "
54+ internal open val pluginId = Const . PLUGIN_ID
5455
5556 private val buildTracker = GradleBuildTracker (" GradlePlugin" )
5657
Original file line number Diff line number Diff line change 1818
1919package io.objectbox.gradle
2020
21+ import io.objectbox.gradle.ProjectEnv.Const
22+
2123
2224/* *
2325 * Like [ObjectBoxGradlePlugin], but adds native libraries that are sync-enabled as dependencies.
2426 */
2527class ObjectBoxSyncGradlePlugin : ObjectBoxGradlePlugin () {
2628
27- override val pluginId = " io.objectbox.sync "
29+ override val pluginId = Const . SYNC_PLUGIN_ID
2830
2931 override fun getLibWithSyncVariantPrefix (): String {
3032 // Use Sync version.
3133 return LIBRARY_NAME_PREFIX_SYNC
3234 }
3335
3436 override fun getLibWithSyncVariantVersion (): String {
35- return ProjectEnv . Const .OBX_DATABASE_SYNC_VERSION
37+ return Const .OBX_DATABASE_SYNC_VERSION
3638 }
3739
3840}
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ import java.util.*
2626
2727class ProjectEnv (val project : Project ) {
2828 object Const {
29+ const val PLUGIN_ID = " io.objectbox"
30+ const val SYNC_PLUGIN_ID = " io.objectbox.sync"
2931 const val EXTENSION_NAME : String = " objectbox"
3032 const val OBX_PLUGIN_VERSION = GradlePluginBuildConfig .VERSION
3133 const val OBX_JAVA_VERSION = GradlePluginBuildConfig .APPLIES_JAVA_VERSION
Original file line number Diff line number Diff line change 1818
1919package io.objectbox.gradle
2020
21+ import io.objectbox.gradle.ProjectEnv.Const
2122import org.gradle.testkit.runner.BuildResult
2223import org.gradle.testkit.runner.GradleRunner
2324import org.intellij.lang.annotations.Language
@@ -76,7 +77,7 @@ class GradleTestRunner(
7677
7778 plugins {
7879 ${additionalPlugins.joinToString(separator = " \n " ) { " id(\" $it \" )" }}
79- id("io.objectbox ")
80+ id("${ Const . PLUGIN_ID } ")
8081 }
8182
8283 java {
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ import org.junit.Assert.assertTrue
3232 */
3333abstract class PluginApplyTest {
3434
35- open val pluginId = " io.objectbox "
35+ open val pluginId = Const . PLUGIN_ID
3636 open val expectedLibWithSyncVariantPrefix = " objectbox"
3737 open val expectedLibWithSyncVariantVersion = Const .OBX_DATABASE_VERSION
3838
Original file line number Diff line number Diff line change 1818
1919package io.objectbox.gradle
2020
21+ import io.objectbox.gradle.ProjectEnv.Const
22+
2123/* *
2224 * Base class to test applying [ObjectBoxSyncGradlePlugin] configures a Java or Kotlin Android Gradle project as expected.
2325 */
2426abstract class SyncPluginApplyAndroidTest : PluginApplyAndroidTest () {
2527
26- override val pluginId = " io.objectbox.sync "
28+ override val pluginId = Const . SYNC_PLUGIN_ID
2729 override val expectedLibWithSyncVariantPrefix = " objectbox-sync"
28- override val expectedLibWithSyncVariantVersion = ProjectEnv . Const .OBX_DATABASE_SYNC_VERSION
30+ override val expectedLibWithSyncVariantVersion = Const .OBX_DATABASE_SYNC_VERSION
2931
3032}
Original file line number Diff line number Diff line change 1818
1919package io.objectbox.gradle
2020
21+ import io.objectbox.gradle.ProjectEnv.Const
22+
2123
2224/* *
2325 * Tests applying [ObjectBoxSyncGradlePlugin] configures a Java or Kotlin desktop Gradle project as expected.
2426 */
2527class SyncPluginApplyJavaTest : PluginApplyJavaTest () {
2628
27- override val pluginId = " io.objectbox.sync "
29+ override val pluginId = Const . SYNC_PLUGIN_ID
2830 override val expectedLibWithSyncVariantPrefix = " objectbox-sync"
2931 override val expectedLibWithSyncVariantVersion = ProjectEnv .Const .OBX_DATABASE_SYNC_VERSION
3032
You can’t perform that action at this time.
0 commit comments