diff --git a/build.gradle b/build.gradle index 7418c2e8f..547372966 100644 --- a/build.gradle +++ b/build.gradle @@ -1,57 +1,46 @@ -/* - * Hello Minecraft! Launcher. - * Copyright (C) 2018 huangyuhui - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see {http://www.gnu.org/licenses/}. - */ - -group 'org.jackhuang' -version '3.0' - -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'org.tukaani:xz:1.8' - } -} - - -subprojects { - apply plugin: 'java' - apply plugin: 'idea' - - repositories { - mavenCentral() - jcenter() - - maven { url 'https://jitpack.io' } - } - - sourceCompatibility = 1.8 - compileJava.options.encoding = "UTF-8" - compileTestJava.options.encoding = "UTF-8" - - dependencies { - compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5' - compile group: 'org.tukaani', name: 'xz', version: '1.8' - compile group: 'org.hildan.fxgson', name: 'fx-gson', version: '3.1.0' - compile group: 'org.jenkins-ci', name: 'constant-pool-scanner', version: '1.2' - compile group: 'com.github.steveice10', name: 'opennbt', version: '1.1' - - testCompile group: 'junit', name: 'junit', version: '4.12' - } - -} +buildscript { + repositories { + jcenter() + maven { url 'https://plugins.gradle.org/m2/' } + } + dependencies { + classpath 'org.tukaani:xz:1.8' + classpath 'gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.15.0' + } +} + +group 'org.jackhuang' +version '3.0' + +subprojects { + apply plugin: 'java' + apply plugin: 'idea' + apply plugin: 'com.github.hierynomus.license' + + repositories { + mavenCentral() + jcenter() + + maven { url 'https://jitpack.io' } + } + + sourceCompatibility = 1.8 + compileJava.options.encoding = "UTF-8" + compileTestJava.options.encoding = "UTF-8" + + dependencies { + compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5' + compile group: 'org.tukaani', name: 'xz', version: '1.8' + compile group: 'org.hildan.fxgson', name: 'fx-gson', version: '3.1.0' + compile group: 'org.jenkins-ci', name: 'constant-pool-scanner', version: '1.2' + compile group: 'com.github.steveice10', name: 'opennbt', version: '1.1' + + testCompile group: 'junit', name: 'junit', version: '4.12' + } + + license { + header rootProject.file('license-header.txt') + strictCheck true + ext.year = Calendar.getInstance().get(Calendar.YEAR) + } +} diff --git a/license-header.txt b/license-header.txt new file mode 100644 index 000000000..b3ce7882d --- /dev/null +++ b/license-header.txt @@ -0,0 +1,15 @@ +Hello Minecraft! Launcher +Copyright (C) ${year} huangyuhui and contributors + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +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 General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see .