Gradle plugin to setup common needs for Netflix OSS projects
This plugin is to support projects in the NetflixOSS org (and it isn't meant to be used elsewhere). It is at its essence just a combination of other plugins that are common to all NetflixOSS projects, with some additional configuration. The primary responsibilities is to:
- Provide release process
- Configure publishing
- Recommend license headers
This project could be used as an example of how a "project plugin" could work. A "project plugin" is a Gradle plugin that provides consistency across many projects, e.g. in a Github org or an enterprise.
For reference, these are Gradle-related modules used:
- com.netflix.nebula:gradle-dependency-lock-plugin - allow project to declare their ideal state of dependencies and lock them to specific versions for releases.
- com.netflix.nebula:gradle-contacts-plugin - to add developers to publications
- com.netflix.nebula:nebula-project-plugin
- com.netflix.nebula:nebula-bintray-plugin - wraps gradle-bintray-plugin with different defaults and adding OJO support and multi-module support.
- com.netflix.nebula:nebula-publishing-plugin - for producing a jar, source jar, javadoc jar with metadata about how it was produced.
- com.netflix.nebula:nebula-release-plugin - for providing release tasks, versioning, and tagging
- nl.javadude.gradle.plugins:license-gradle-plugin - for license recommendations
This plugin was tested with Gradle 4.4
To include, add the following to your build.gradle
If using gradle 2.1 or newer:
plugins {
id 'nebula.netflixoss' version '5.1.1'
}
-or-
buildscript {
repositories { mavenCentral() }
dependencies { classpath 'com.netflix.nebula:gradle-netflixoss-project-plugin:5.1.1' }
}
allprojects {
apply plugin: 'nebula.netflixoss'
}
These are some of the defaults that are set.
-
sourceCompatibility 1.7: Please change if you want to publish to older or newer java versions
-
release.scope set to minor: By default always bump the minor version
-
a placeholder developer is added to the contacts section: to add more see gradle-contacts-plugin
contacts { '[email protected]' { github '' moniker 'First Last' } }
By default the license check is on. To turn it off:
license {
ignoreFailures = true
}
NOTE: We disable the devSnapshot
and immutableSnapshot
tasks since we release to oss.jfrog.org with maven style -SNAPSHOT versions and those tasks are using incompatible version patterns.
snapshot
- release a snapshot version, does not create a tag, the version will bemajor.minor.patch-SNAPSHOT
candidate
- release a candidate version, creates a tag, the version will bemajor.minor.patch-rc.#
final
- release a final version, creates a tag, the version will bemajor.minor.patch
-Prelease.scope - can be used to change which part of the version string is changed
- major - If last tag was v1.2.3 the release would go to v2.0.0
- minor - If last tag was v1.2.3 the release would go to v1.3.0, this is the default
- patch - If last tag was v1.2.3 the release would go to v1.2.4
-Prelease.travisci - takes a boolean, true disables the prepare checks and release tagging, false(the default) leaves the normal checks in place. -Prelease.disableGitChecks - does the same as above
snapshot
builds are published to oss.jfrog.org
candidate
we publish to a special candidate repo https://dl.bintray.com/netflixoss/oss-candidate
final
we publish to jcenter and mavenCentral
if the following property is in place and set to false we will publish to jcenter and mavenCentral instead of a staging candidate repo
./gradlew -PnetflixossAltCandidateRepo=false clean candidate
Built with Oracle JDK7 Tested with Oracle JDK8
Gradle Version | Works |
---|---|
<= 4.3.1 | no |
4.4 | yes |
Copyright 2014-2019 Netflix, Inc.
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.