nebula-project-plugin

Healthy defaults for a standard Gradle project

  • 所有者: nebula-plugins/nebula-project-plugin
  • 平台:
  • 许可证: Apache License 2.0
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Nebula Project Plugin

Support Status
Build Status
Coverage Status
Gitter
Apache 2.0

Provides healthy defaults for a Gradle project. Currently adds:

  • Builds Javadoc and Sources jars
  • Record information about the build and stores it in the .jar, via gradle-info-plugin
  • Easy specification of people involved in a project via gradle-contacts-plugin
  • Doesn't fail javadoc if there are none found

Compatibilty notes

This plugin uses APIs that are not available on Gradle < 5.0.

From v7.0.0, nebula-project-plugin supports only Gradle 5.0+

Nebula Facet Plugin

A routine pattern is wanting a new SourceSet with an accompanying Configuration for dependencies. We consider this another facet of your project and can be modeled via the Nebula Facet plugin. This plugin will create a SourceSet with the name provided, which extends the main SourceSet, and consequently it'll create configurations for compile and runtime, which extends from the parent SourceSet. Their "classes" task will be wired up to the build task.

apply plugin: 'nebula.facet'
facets {
    examples
    performance
}

The previous definition would make examples and performance SourceSets, so that code can go in src/examples/java and src/performance/java. It'll get four configurations: examplesCompile, examplesRuntime, performanceCompile, performanceRuntime. Those configuration will extends compile and runtime respectively. Each one can be configured to inherit from another SourceSet, e.g.

facets {
    functional {
        parentSourceSet = 'test'
    }
}

That will cause the functionalCompile to extend from testCompile, and functionalRuntime to extend from testRuntime, since those are the configurations from the "test" SourceSet.

Test Facets

If "Test" is in the facet name, then a Test task would be created (though it'll still inherit from the "main" SourceSet, use the above configuration to make the test facet extends from the test SourceSet). For example:

facets {
    integTest
}

This will create a test task called integTest in addition to the integTest SourceSet. The parent SourceSet can still be overriden like above, and the task name can be set:

facets {
    integTest {
        parentSourceSet = 'main'
        testTaskName = 'integrationTest'
    }
}

Test facets may opt out of a dependency on the 'check' task by using includeInCheckLifecycle:

facets {
    integTest {
        parentSourceSet = 'main'
        testTaskName = 'integrationTest'
        includeInCheckLifecycle = false
    }
}

Nebula IntegTest Plugin

A corrolary from the Facet Plugin is a concrete Facet, this plugin provides one specifically for Integration Tests. By applying this plugin, you'll get an integrationTest Test task, where sources go in src/integTest/java and dependencies can go into integTestCompile and integTestRuntime (which extend from the test SourceSet), with the 'check' task depending on the task. To apply the plugin:

apply plugin: 'nebula.integtest'

Alternatively, the task can be a standalone task that isn't depended on by check by applying:

apply plugin: 'nebula.integtest-standalone'

主要指标

概览
名称与所有者nebula-plugins/nebula-project-plugin
主编程语言Groovy
编程语言Groovy (语言数: 1)
平台
许可证Apache License 2.0
所有者活动
创建于2014-01-10 19:04:07
推送于2025-04-25 22:52:47
最后一次提交
发布数101
最新版本名称v11.0.0 (发布于 )
第一版名称1.9.0 (发布于 2014-01-10 21:43:33)
用户参与
星数94
关注者数20
派生数19
提交数629
已启用问题?
问题数32
打开的问题数13
拉请求数52
打开的拉请求数2
关闭的拉请求数5
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?