I am building the HyperQuest plugin atm at www.github.com/kourbou/HyperQuest but I am having trouble with my Gradle build. I am 100% new to Gradle and I wanted to get the License pre-commit system Sponge has but I tried copying the build.gradle file sponge has and it failed. Could someone help me out? Thanks a lot, in advance.
PS: I posted this in Plugin Support. If this was incorrect please move it to the proper category. Thanks.
will make gradle run that task every time you use it automatically.
For license header formatting do this:
license {
//the project name to use
ext.name = project.name
//the organizations name etc
ext.organization = project.organization
ext.url = project.url
ext.year = project.inceptionYear
//for usage of these values see this: https://github.com/hierynomus/license-gradle-plugin#variable-substitution
//files to exclude from formatting (anything that is a .info file and assets in this example)
exclude "**/*.info"
exclude "assets/**"
//the file that contains the header
header file('HEADER.txt')
//the source sets to apply the license to
//this should be enough for you, it covers all the projects source sets
sourceSets = project.sourceSets
ignoreFailures false
strictCheck true
//what style your comment should be
mapping {
//in this case it's the following: /* and then continuing with stars.
java = 'SLASHSTAR_STYLE'
}
}
Further documentation of the license section can be found here: GitHub
lol. Sorry forgot to commit (done now). See when I run ./gradlew licenseFormat it just says UP-TO-DATE and no headers get added in the file. I have tried everything.
Edit: Wow I am very sorry you had to write all of this. I actually have most of what you did in the Gradle file. Still nothing⦠Just the āits uptodate man!ā and no changes in files.
Well, yes, the issue is in fact that you have not source sets or are not using them, if I build your project the jar only contains the META-INF and no compiled classes.
So, the problem was, that you had your source directory set up in a non conventional way (convention: src/main/java/yourpackageshere, yours: src/yourpackageshere). That non conventional setup requires adding the directory to the sourceSets specifically. Iād recomment that you go with just refactoring it to fith the convention.