Skip to content

Commit

Permalink
Merge pull request #172 from sabberworm/avoid-configuring-tasks
Browse files Browse the repository at this point in the history
feat(performance): don’t force tasks to be created
  • Loading branch information
rpalcolea committed Dec 2, 2019
2 parents b77c9d8 + 1450915 commit 9ed84ce
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
Expand Up @@ -60,7 +60,7 @@ class BaseReleasePlugin implements Plugin<Project> {
}
}

project.tasks.all { task ->
project.tasks.configureEach { task ->
if (name != PREPARE_TASK_NAME) {
task.shouldRunAfter PREPARE_TASK_NAME
}
Expand Down
@@ -0,0 +1,35 @@
/**
* Copyright 2016 the original author or authors.
*
* Licensed 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 nebula.plugin.release

import nebula.test.ProjectSpec
import nebula.plugin.release.git.base.BaseReleasePlugin
import nebula.plugin.release.git.base.ReleasePluginExtension

class ReleasePluginConfigurationAvoidanceSpec extends ProjectSpec {
def 'able to configure tasks lazily'() {
setup:
project.tasks.register('sync') {
throw new Exception('Should not be configured')
}

when:
project.plugins.apply(BaseReleasePlugin)

then:
notThrown(Exception)
}
}

0 comments on commit 9ed84ce

Please sign in to comment.