Skip to content

Commit

Permalink
Integrated license plugin (RM-2223)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbe-axelor committed Jul 25, 2014
1 parent 0405ff0 commit f1b7cdb
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 0 deletions.
8 changes: 8 additions & 0 deletions axelor-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ apply plugin: "eclipse-wtp"

apply from: "../repo.gradle"
apply from: "../libs.gradle"
apply from: "../license.gradle"

buildscript {
apply from: "../repo.gradle"
dependencies {
classpath libs.plugin_license
}
}

sourceCompatibility = 1.7
targetCompatibility = 1.7
Expand Down
10 changes: 10 additions & 0 deletions axelor-gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ apply plugin: 'eclipse'

apply from: '../libs.gradle'
apply from: '../repo.gradle'
apply from: '../license.gradle'

buildscript {
apply from: '../repo.gradle'
apply from: '../libs.gradle'
dependencies {
classpath libs.plugin_license
}
}

dependencies {

Expand All @@ -18,6 +27,7 @@ dependencies {
compile libs.jersey_server
compile project(':core:axelor-common')

compile libs.plugin_license
compile libs.plugin_tomcat
}

Expand Down
15 changes: 15 additions & 0 deletions header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
${product}

Copyright (C) ${inception}-${year} ${owner} (<${website}>).

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License, version 3,
as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
1 change: 1 addition & 0 deletions libs.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ ext {
ST4: "org.antlr:ST4:4.0.7",

// gradle plugins
plugin_license: "nl.javadude.gradle.plugins:license-gradle-plugin:0.10.0",
plugin_tomcat: "org.gradle.api.plugins:gradle-tomcat-plugin:1.2.4",
]
}
Expand Down
48 changes: 48 additions & 0 deletions license.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

def findHeaderFile() {
def files = ["header.txt", "../header.txt", "${rootDir}/core/header.txt"]
for (name in files) {
if (file(name).exists()) {
return file(name)
}
}
return "src/license/header.txt"
}

project.apply plugin: "license"

project.license {

header findHeaderFile()

ignoreFailures true

ext.product = "Axelor Business Solutions"
ext.inception = "2012"
ext.year = Calendar.getInstance().get(Calendar.YEAR)
ext.owner = "Axelor"
ext.website = "http://axelor.com"

include "**/*.java"
include "**/*.groovy"
include "**/*.scala"
include "**/*.js"

excludes(["**/LICENSE", "**/LICENSE.md"])
excludes(["**/README", "**/README.md"])
excludes(["**/*.properties", "**/*.txt", "**/*.json"])
}

project.tasks.findAll { it.class.simpleName.startsWith 'License' }.each {

it.source = fileTree(dir: 'src', excludes: [
"**/data/**",
"**/data-init/**",
"**/data-demo/**",
"**/src-gen/**",
"**/resources/**",
"**/webapp/lib/**",
"**/webapp/WEB-INF/web.xml"
])
}

0 comments on commit f1b7cdb

Please sign in to comment.