-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from UniVE-SSV/modularization
Modularization
- Loading branch information
Showing
560 changed files
with
2,364 additions
and
737 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,3 @@ | |
# These are explicitly windows files and should use crlf | ||
*.bat text eol=crlf | ||
|
||
|
||
* text eol=lf | ||
*.jar -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,4 +44,5 @@ local.properties | |
diagrams/ | ||
|
||
# tests | ||
test-outputs/ | ||
test-outputs/ | ||
/bin/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,96 +1,84 @@ | ||
/* | ||
* This file contains the general configuration of the build script and the list of plugins to apply. | ||
* Anything else, with very few exceptions, should be placed into a separate gradle file that has to | ||
* be applied at the end of this file. | ||
* be applied at the end of this file, or in project-specific build files. | ||
* | ||
* When defining a custom task, use 'tasks.register("taskname")', specifying also group and description, | ||
* When defining a custom task, use 'tasks.register('taskname')', specifying also group and description, | ||
* to help others understand the purpose of that task. | ||
*/ | ||
buildscript { | ||
repositories { | ||
jcenter() | ||
mavenCentral() | ||
} | ||
dependencies { | ||
classpath 'org.ajoberstar.grgit:grgit-core:4.0.2' | ||
classpath 'org.ajoberstar.grgit:grgit-gradle:4.0.2' | ||
} | ||
} | ||
|
||
plugins { | ||
// telling gradle that we are building a library | ||
id 'java-library' | ||
|
||
// magic for getting eclipse to work with gradle | ||
id 'eclipse' | ||
|
||
// antlr plugin for the generation of the IMP parser | ||
id 'antlr' | ||
|
||
// automatic generation of plantuml files from the source code | ||
// for visualizing them: https://www.planttext.com/ | ||
id 'com.github.roroche.plantuml' version '1.0.2' | ||
|
||
// this can generate images from plantuml files | ||
// it requires graphviz to be installed | ||
id "org.fmiw.plantuml" version "0.1" | ||
|
||
// parse git information during the build | ||
id 'org.ajoberstar.grgit' version '4.0.2' | ||
|
||
// code formatting task -- spotlessCheck for checking, spotlessApply for applying | ||
id "com.diffplug.spotless" version "5.8.2" | ||
|
||
// javadoc checking - coding conventions | ||
id 'checkstyle' | ||
allprojects { | ||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
// this enables './gradlew <task> taskTree' to show task dependencies | ||
id "com.dorongold.task-tree" version "1.5" | ||
|
||
// publication on maven central | ||
id 'maven-publish' | ||
id 'signing' | ||
|
||
// coverage reports | ||
id 'jacoco' | ||
} | ||
group = 'it.unive' | ||
version = '0.1b1' | ||
|
||
// the code reading data from the git repo has to be placed in the same file where its | ||
// plugin is applied, otherwise it will fail to load the classes from it. We export the | ||
// properties that we read for using them later in the appropriate gradle files | ||
def ready = false | ||
def cid = '' | ||
def tag = '' | ||
def branch = '' | ||
def is_clean = '' | ||
try { | ||
def repo = org.ajoberstar.grgit.Grgit.open(dir: rootProject.projectDir.getParent()) | ||
ready = true | ||
cid = repo.head().abbreviatedId | ||
tag = repo.describe(tags: true, always: true) | ||
branch = repo.branch.current().getName() | ||
is_clean = repo.status().isClean() | ||
} catch (Exception e) { | ||
// this means we are building from outside of LiSA, probably from an outer model | ||
// we can skip the manifest attributes injection here | ||
println("Skipping manifest attriubtes injection because we are not directly building LiSA") | ||
println(e) | ||
// the code reading data from the git repo has to be placed in the same file where its | ||
// plugin is applied, otherwise it will fail to load the classes from it. We export the | ||
// properties that we read for using them later in the appropriate gradle files | ||
def ready = false | ||
def cid = '' | ||
def tag = '' | ||
def branch = '' | ||
def is_clean = '' | ||
try { | ||
def repo = org.ajoberstar.grgit.Grgit.open(dir: rootProject.projectDir.getParent()) | ||
ready = true | ||
cid = repo.head().abbreviatedId | ||
tag = repo.describe(tags: true, always: true) | ||
branch = repo.branch.current().getName() | ||
is_clean = repo.status().isClean() | ||
} catch (Exception e) { | ||
// this means we are building from outside of LiSA, probably from an outer model | ||
// we can skip the manifest attributes injection here | ||
println('Skipping manifest attriubtes injection because we are not directly building LiSA') | ||
println(e) | ||
} | ||
|
||
ext { | ||
git_ready = ready | ||
git_cid = cid | ||
git_tag = tag | ||
git_branch = branch | ||
git_is_clean = is_clean | ||
} | ||
} | ||
|
||
ext { | ||
git_ready = ready | ||
git_cid = cid | ||
git_tag = tag | ||
git_branch = branch | ||
git_is_clean = is_clean | ||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
maven { | ||
url 'https://plugins.gradle.org/m2/' | ||
} | ||
} | ||
|
||
dependencies { | ||
classpath 'org.ajoberstar.grgit:grgit-core:4.0.2' | ||
classpath 'org.ajoberstar.grgit:grgit-gradle:4.0.2' | ||
|
||
classpath 'com.github.roroche:plantuml-gradle-plugin:1.0.2' | ||
classpath 'gradle.plugin.org.fmiw:plantuml-gradle-plugin:0.1' | ||
|
||
classpath 'com.diffplug.spotless:spotless-plugin-gradle:5.15.0' | ||
} | ||
} | ||
|
||
group = 'it.unive' | ||
version = '0.1b1' | ||
|
||
apply from: 'dependencies.gradle' | ||
apply from: 'java.gradle' | ||
apply from: 'code-style.gradle' | ||
apply from: 'doc-extra.gradle' | ||
apply from: 'antlr.gradle' | ||
apply from: 'publishing.gradle' | ||
subprojects { | ||
apply plugin: 'java-library' | ||
apply plugin: 'eclipse' | ||
apply plugin: 'com.github.roroche.plantuml' // generation of plantuml from source code (visualization: https://www.planttext.com/) | ||
apply plugin: 'org.fmiw.plantuml' // plantuml to png | ||
apply plugin: 'org.ajoberstar.grgit' // parse git information during the build | ||
apply plugin: 'com.diffplug.spotless' // code formatting task | ||
apply plugin: 'checkstyle' // javadoc checking - coding conventions | ||
apply plugin: 'maven-publish' // publication on maven central | ||
apply plugin: 'signing' // artifact signing | ||
apply plugin: 'jacoco' // coverage reports | ||
|
||
apply from: "${project.rootDir}/code-style.gradle" | ||
apply from: "${project.rootDir}/doc-extra.gradle" | ||
apply from: "${project.rootDir}/java.gradle" | ||
apply from: "${project.rootDir}/publishing.gradle" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,85 @@ | ||
checkstyle { | ||
configFile = file("checkstyle-config.xml") | ||
sourceSets = [] | ||
showViolations = true | ||
toolVersion '8.38' | ||
configFile = file(new File(rootProject.projectDir, 'checkstyle-config.xml')) | ||
sourceSets = [] | ||
showViolations = true | ||
toolVersion '8.38' | ||
} | ||
|
||
checkstyleMain { | ||
finalizedBy 'checkstyleErrorMessage' | ||
reports { | ||
xml.enabled false | ||
html.enabled false | ||
} | ||
} | ||
checkstyleTest.enabled = false | ||
|
||
checkstyleTest { | ||
finalizedBy 'checkstyleErrorMessage' | ||
checkstyleMain { | ||
finalizedBy 'checkstyleErrorMessage' | ||
reports { | ||
xml.enabled false | ||
html.enabled false | ||
xml.required = false | ||
html.required = false | ||
} | ||
|
||
// only included files will be checked | ||
include 'it/unive/lisa/test/imp/**/*.java' | ||
exclude '**/*Test.java' | ||
} | ||
|
||
task checkstyleErrorMessage { | ||
onlyIf { | ||
checkstyleMain.state.failure != null || checkstyleTest.state.failure != null | ||
} | ||
doLast { | ||
logger.error('Checkstyle plugin thrown an error. This means that the javadoc is not correctly setup. Inspect console output to find problematic javadocs.') | ||
logger.error('To reproduce locally, execute \'./gradlew checkstyleMain checkstyleTest\'') | ||
} | ||
onlyIf { | ||
checkstyleMain.state.failure != null | ||
} | ||
doLast { | ||
logger.error('Checkstyle plugin thrown an error. This means that the javadoc is not correctly setup. Inspect console output to find problematic javadocs.') | ||
logger.error('To reproduce locally, execute \'./gradlew checkstyleMain\'') | ||
} | ||
} | ||
|
||
spotless { | ||
enforceCheck = false | ||
encoding 'UTF-8' | ||
lineEndings 'UNIX' | ||
java { | ||
// tabs, no spaces | ||
indentWithTabs() | ||
enforceCheck = false | ||
encoding 'UTF-8' | ||
lineEndings 'UNIX' | ||
java { | ||
// tabs, no spaces | ||
indentWithTabs() | ||
|
||
// keep imports clean | ||
importOrder() | ||
removeUnusedImports() | ||
// keep imports clean | ||
importOrder() | ||
removeUnusedImports() | ||
|
||
// use the eclipse formatting with the one provided with the project | ||
eclipse().configFile('spotless-formatting.xml') | ||
// use the eclipse formatting with the one provided with the project | ||
eclipse().configFile(new File(rootProject.projectDir, 'spotless-formatting.xml')) | ||
|
||
// ignore generated code | ||
target project.fileTree(project.projectDir) { | ||
include '**/*.java' | ||
exclude '**/build/generated/**' | ||
exclude '**/build/generated-src/**' | ||
exclude '**/target/generated-sources/**' | ||
} | ||
} | ||
antlr4 { | ||
target 'src/*/antlr/**/*.g4' | ||
antlr4Formatter() | ||
} | ||
// ignore generated code | ||
target project.fileTree(project.projectDir) { | ||
include '**/*.java' | ||
exclude '**/build/generated/**' | ||
exclude '**/build/generated-src/**' | ||
exclude '**/target/generated-sources/**' | ||
} | ||
} | ||
antlr4 { | ||
target 'src/*/antlr/**/*.g4' | ||
antlr4Formatter() | ||
} | ||
} | ||
|
||
spotlessJava { | ||
// declaring explicit dependencies | ||
dependsOn 'compileJava', 'compileTestJava', 'processTestResources', 'spotlessAntlr4' | ||
} | ||
|
||
spotlessJavaCheck { | ||
finalizedBy 'spotlessErrorMessage' | ||
finalizedBy 'spotlessErrorMessage' | ||
} | ||
|
||
spotlessAntlr4Check { | ||
finalizedBy 'spotlessErrorMessage' | ||
finalizedBy 'spotlessErrorMessage' | ||
} | ||
|
||
task spotlessErrorMessage { | ||
onlyIf { | ||
spotlessJavaCheck.state.failure != null || spotlessAntlr4Check.state.failure != null | ||
} | ||
doLast { | ||
logger.error('Spotless plugin thrown an error. This means that the code is not correctly formatted.') | ||
logger.error('To reproduce locally, execute \'./gradlew spotlessCheck\'') | ||
logger.error('To automatically fix all the problems, execute \'./gradlew spotlessApply\'') | ||
} | ||
onlyIf { | ||
spotlessJavaCheck.state.failure != null || spotlessAntlr4Check.state.failure != null | ||
} | ||
doLast { | ||
logger.error('Spotless plugin thrown an error. This means that the code is not correctly formatted.') | ||
logger.error('To reproduce locally, execute \'./gradlew spotlessCheck\'') | ||
logger.error('To automatically fix all the problems, execute \'./gradlew spotlessApply\'') | ||
} | ||
} | ||
|
||
tasks.register('checkCodeStyle') { | ||
group = 'verification' | ||
description = 'Execute spotless and checkstyle to ensure code and javadoc formatting' | ||
dependsOn 'spotlessCheck', 'checkstyleMain', 'checkstyleTest' | ||
dependsOn 'spotlessCheck', 'checkstyleMain', 'checkstyleTest' | ||
} |
Oops, something went wrong.