build: introduce convenience tasks to check groups of projects ./gradlew checkCore ./gradlew checkLibraries ./gradlew checkExtensions ./gradlew checkTools ./gradlew checkTutorials ./gradlew checkSamples
Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/1170af39 Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/1170af39 Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/1170af39 Branch: refs/heads/develop Commit: 1170af3993ef091f68cd4f393b73f15b318ddb71 Parents: 86f8fc1 Author: Paul Merlin <[email protected]> Authored: Sat May 27 10:16:58 2017 +0200 Committer: Paul Merlin <[email protected]> Committed: Sat May 27 10:27:09 2017 +0200 ---------------------------------------------------------------------- .../gradle/structure/ProjectGroupTasks.groovy | 36 ++++++++++++++++++++ .../gradle/structure/core/CorePlugin.groovy | 3 ++ .../structure/extensions/ExtensionPlugin.groovy | 3 ++ .../structure/libraries/LibraryPlugin.groovy | 5 +++ .../structure/samples/SamplePlugin.groovy | 3 ++ .../gradle/structure/tools/ToolPlugin.groovy | 3 ++ .../structure/tutorials/TutorialPlugin.groovy | 3 ++ 7 files changed, 56 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/polygene-java/blob/1170af39/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/ProjectGroupTasks.groovy ---------------------------------------------------------------------- diff --git a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/ProjectGroupTasks.groovy b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/ProjectGroupTasks.groovy new file mode 100644 index 0000000..2bc42d7 --- /dev/null +++ b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/ProjectGroupTasks.groovy @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.polygene.gradle.structure + +import groovy.transform.CompileStatic +import org.apache.polygene.gradle.TaskGroups +import org.gradle.api.Project +import org.gradle.api.Task + +@CompileStatic +class ProjectGroupTasks +{ + static void configureProjectGroupTasks( String projectGroup, Project project ) + { + project.tasks.create( "check${ projectGroup.capitalize() }" ) { Task task -> + task.group = TaskGroups.VERIFICATION + task.description = "Runs the $projectGroup checks" + task.dependsOn( project.tasks.getByName( "check" ) ) + } + } +} http://git-wip-us.apache.org/repos/asf/polygene-java/blob/1170af39/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/core/CorePlugin.groovy ---------------------------------------------------------------------- diff --git a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/core/CorePlugin.groovy b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/core/CorePlugin.groovy index a07d88f..c75ec77 100644 --- a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/core/CorePlugin.groovy +++ b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/core/CorePlugin.groovy @@ -23,6 +23,8 @@ import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.tasks.compile.JavaCompile +import static org.apache.polygene.gradle.structure.ProjectGroupTasks.configureProjectGroupTasks + @CompileStatic class CorePlugin implements Plugin<Project> { @@ -31,6 +33,7 @@ class CorePlugin implements Plugin<Project> { project.plugins.apply PublishedCodePlugin configureJava( project ) + configureProjectGroupTasks( "core", project ) } private static void configureJava( Project project ) http://git-wip-us.apache.org/repos/asf/polygene-java/blob/1170af39/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/extensions/ExtensionPlugin.groovy ---------------------------------------------------------------------- diff --git a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/extensions/ExtensionPlugin.groovy b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/extensions/ExtensionPlugin.groovy index 735952c..5bf0e66 100644 --- a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/extensions/ExtensionPlugin.groovy +++ b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/extensions/ExtensionPlugin.groovy @@ -22,6 +22,8 @@ import org.apache.polygene.gradle.code.PublishedCodePlugin import org.gradle.api.Plugin import org.gradle.api.Project +import static org.apache.polygene.gradle.structure.ProjectGroupTasks.configureProjectGroupTasks + @CompileStatic class ExtensionPlugin implements Plugin<Project> { @@ -29,5 +31,6 @@ class ExtensionPlugin implements Plugin<Project> void apply( Project project ) { project.plugins.apply PublishedCodePlugin + configureProjectGroupTasks( "extensions", project ) } } http://git-wip-us.apache.org/repos/asf/polygene-java/blob/1170af39/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/libraries/LibraryPlugin.groovy ---------------------------------------------------------------------- diff --git a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/libraries/LibraryPlugin.groovy b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/libraries/LibraryPlugin.groovy index 7603e8b..0abce5d 100644 --- a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/libraries/LibraryPlugin.groovy +++ b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/libraries/LibraryPlugin.groovy @@ -17,15 +17,20 @@ */ package org.apache.polygene.gradle.structure.libraries +import groovy.transform.CompileStatic import org.apache.polygene.gradle.code.PublishedCodePlugin import org.gradle.api.Plugin import org.gradle.api.Project +import static org.apache.polygene.gradle.structure.ProjectGroupTasks.configureProjectGroupTasks + +@CompileStatic class LibraryPlugin implements Plugin<Project> { @Override void apply( Project project ) { project.plugins.apply PublishedCodePlugin + configureProjectGroupTasks( "libraries", project ) } } http://git-wip-us.apache.org/repos/asf/polygene-java/blob/1170af39/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/samples/SamplePlugin.groovy ---------------------------------------------------------------------- diff --git a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/samples/SamplePlugin.groovy b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/samples/SamplePlugin.groovy index 6970463..09094d8 100644 --- a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/samples/SamplePlugin.groovy +++ b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/samples/SamplePlugin.groovy @@ -22,6 +22,8 @@ import org.apache.polygene.gradle.code.CodePlugin import org.gradle.api.Plugin import org.gradle.api.Project +import static org.apache.polygene.gradle.structure.ProjectGroupTasks.configureProjectGroupTasks + @CompileStatic class SamplePlugin implements Plugin<Project> { @@ -29,5 +31,6 @@ class SamplePlugin implements Plugin<Project> void apply( Project project ) { project.plugins.apply CodePlugin + configureProjectGroupTasks( "samples", project ) } } http://git-wip-us.apache.org/repos/asf/polygene-java/blob/1170af39/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/tools/ToolPlugin.groovy ---------------------------------------------------------------------- diff --git a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/tools/ToolPlugin.groovy b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/tools/ToolPlugin.groovy index a57a129..eb5740b 100644 --- a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/tools/ToolPlugin.groovy +++ b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/tools/ToolPlugin.groovy @@ -21,11 +21,14 @@ import org.apache.polygene.gradle.code.PublishedCodePlugin import org.gradle.api.Plugin import org.gradle.api.Project +import static org.apache.polygene.gradle.structure.ProjectGroupTasks.configureProjectGroupTasks + class ToolPlugin implements Plugin<Project> { @Override void apply( Project project ) { project.plugins.apply PublishedCodePlugin + configureProjectGroupTasks( "tools", project ) } } http://git-wip-us.apache.org/repos/asf/polygene-java/blob/1170af39/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/tutorials/TutorialPlugin.groovy ---------------------------------------------------------------------- diff --git a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/tutorials/TutorialPlugin.groovy b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/tutorials/TutorialPlugin.groovy index a831fd8..1dacd3f 100644 --- a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/tutorials/TutorialPlugin.groovy +++ b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/tutorials/TutorialPlugin.groovy @@ -22,6 +22,8 @@ import org.apache.polygene.gradle.code.CodePlugin import org.gradle.api.Plugin import org.gradle.api.Project +import static org.apache.polygene.gradle.structure.ProjectGroupTasks.configureProjectGroupTasks + @CompileStatic class TutorialPlugin implements Plugin<Project> { @@ -29,5 +31,6 @@ class TutorialPlugin implements Plugin<Project> void apply( Project project ) { project.plugins.apply CodePlugin + configureProjectGroupTasks( "tutorials", project ) } }
