From 0f0c6114889de1c0c3d702661aa44f95ec76edea Mon Sep 17 00:00:00 2001 From: Justin Ryan Date: Fri, 17 Aug 2012 16:02:17 -0700 Subject: [PATCH] Enable license header plugin --- build.gradle | 4 +++- codequality/HEADER | 2 +- gradle/buildscript.gradle | 3 +++ gradle/license.gradle | 12 ++++++++---- 4 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 gradle/buildscript.gradle diff --git a/build.gradle b/build.gradle index db703963..fae039b4 100644 --- a/build.gradle +++ b/build.gradle @@ -4,6 +4,7 @@ ext.githubProjectName = rootProject.name // TEMPLATE: change to match github pro buildscript { repositories { mavenCentral() } + apply from: file('gradle/buildscript.gradle'), to: buildscript } allprojects { @@ -14,7 +15,7 @@ allprojects { apply from: file('gradle/convention.gradle') apply from: file('gradle/maven.gradle') apply from: file('gradle/check.gradle') -//apply from: file('gradle/license.gradle') // Waiting for re-release +apply from: file('gradle/license.gradle') subprojects { // Closure to configure all the POM with extra info, common to all projects @@ -44,6 +45,7 @@ subprojects { } project(':template-client') { + apply plugin: 'java' dependencies { compile 'org.slf4j:slf4j-api:1.6.3' compile 'com.sun.jersey:jersey-client:1.11' diff --git a/codequality/HEADER b/codequality/HEADER index 6c5c7c9c..3102e4b4 100644 --- a/codequality/HEADER +++ b/codequality/HEADER @@ -1,4 +1,4 @@ -Copyright 2012 Netflix, Inc. +Copyright ${year} Netflix, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/gradle/buildscript.gradle b/gradle/buildscript.gradle new file mode 100644 index 00000000..77d13d10 --- /dev/null +++ b/gradle/buildscript.gradle @@ -0,0 +1,3 @@ +// Executed in context of buildscript +dependencies { classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.6.0' } + diff --git a/gradle/license.gradle b/gradle/license.gradle index 1fdc2702..11a51f11 100644 --- a/gradle/license.gradle +++ b/gradle/license.gradle @@ -1,5 +1,9 @@ -buildscript { - dependencies { classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.5' } -} +// Dependency for plugin was set in buildscript.gradle -apply plugin: nl.javadude.gradle.plugins.license.LicensePlugin +subprojects { +apply plugin: 'license' //nl.javadude.gradle.plugins.license.LicensePlugin +license { + header rootProject.file('codequality/HEADER') + ext.year = Calendar.getInstance().get(Calendar.YEAR) +} +}