-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add aggregate *All tasks and stub * tasks
- Loading branch information
Showing
3 changed files
with
133 additions
and
101 deletions.
There are no files selected for viewing
43 changes: 13 additions & 30 deletions
43
convention-plugin/src/main/kotlin/org/metaborg/convention/RootProjectConventionExtension.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,26 @@ | ||
package org.metaborg.convention | ||
|
||
import org.gradle.api.model.ObjectFactory | ||
import org.gradle.api.plugins.JavaPlugin | ||
import org.gradle.api.provider.Property | ||
import org.gradle.api.publish.plugins.PublishingPlugin | ||
import org.gradle.language.base.plugins.LifecycleBasePlugin | ||
import javax.inject.Inject | ||
|
||
/** Configuration for the root project convention. */ | ||
open class RootProjectConventionExtension @Inject constructor( | ||
/** The Gradle object factory. */ | ||
objects: ObjectFactory, | ||
) { | ||
/** Suffix for all task names. */ | ||
val taskNameSuffix: Property<String> = objects.property(String::class.java) | ||
.convention("") | ||
|
||
/** The name of the `assemble` task. */ | ||
val assembleTaskName: Property<String> = objects.property(String::class.java) | ||
.convention(taskNameSuffix.map { "${LifecycleBasePlugin.ASSEMBLE_TASK_NAME}$it"} ) | ||
/** The name of the `build` task. */ | ||
val buildTaskName: Property<String> = objects.property(String::class.java) | ||
.convention(taskNameSuffix.map { "${LifecycleBasePlugin.BUILD_TASK_NAME}$it"} ) | ||
/** The name of the `clean` task. */ | ||
val cleanTaskName: Property<String> = objects.property(String::class.java) | ||
.convention(taskNameSuffix.map { "${LifecycleBasePlugin.CLEAN_TASK_NAME}$it"} ) | ||
/** The name of the `publish` task. */ | ||
val publishTaskName: Property<String> = objects.property(String::class.java) | ||
.convention(taskNameSuffix.map { "${PublishingPlugin.PUBLISH_LIFECYCLE_TASK_NAME}$it"} ) | ||
/** The name of the `publishToMavenLocal` task. */ | ||
val publishToMavenLocalTaskName: Property<String> = objects.property(String::class.java) | ||
.convention(taskNameSuffix.map { "${PublishingPlugin.PUBLISH_LIFECYCLE_TASK_NAME}${it}ToMavenLocal"} ) | ||
/** The name of the `check` task. */ | ||
val checkTaskName: Property<String> = objects.property(String::class.java) | ||
.convention(taskNameSuffix.map { "${LifecycleBasePlugin.CHECK_TASK_NAME}$it"} ) | ||
/** The name of the `test` task. */ | ||
val testTaskName: Property<String> = objects.property(String::class.java) | ||
.convention(taskNameSuffix.map { "${JavaPlugin.TEST_TASK_NAME}$it"} ) | ||
/** The name of the `tasks` task. */ | ||
val tasksTaskName: Property<String> = objects.property(String::class.java) | ||
.convention("allTasks") | ||
/** Whether to add the aggregate `assembleAll`, `buildAll`, `checkAll`, and `cleanAll` lifecycle tasks. */ | ||
val addAggregateLifecycleTasks: Property<Boolean> = objects.property(Boolean::class.java) | ||
.convention(true) | ||
/** Whether to add the aggregate `publishAll`, `publishAllToMavenLocal` lifecycle tasks. */ | ||
val addAggregatePublishTasks: Property<Boolean> = objects.property(Boolean::class.java) | ||
.convention(false) | ||
|
||
/** Whether to add stub `assemble`, `build`, `check`, and `clean` lifecycle tasks that depend on their `*All` counterparts, if not already defined. */ | ||
val addStubLifecycleTasks: Property<Boolean> = objects.property(Boolean::class.java) | ||
.convention(true) | ||
/** Whether to add stub `publish` and `publishToMavenLocal` tasks that depend on their `*All` counterparts, if not already defined. */ | ||
val addStubPublishTasks: Property<Boolean> = objects.property(Boolean::class.java) | ||
.convention(false) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters