apply plugin: 'application' apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'maven-publish' apply plugin: 'signing' allprojects { project.group = 'de.hhu.stups' project.version = '3.7.0-SNAPSHOT' project.ext.isSnapshot = project.version.endsWith("-SNAPSHOT") ext."signing.secretKeyRingFile" = rootProject.file("secring.gpg").absolutePath } repositories { mavenCentral() } dependencies { implementation(project(":sablecc-runtime")) } java { sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 withSourcesJar() withJavadocJar() } application { mainClass = "org.sablecc.sablecc.SableCC" } processResources { inputs.property("project.version", project.version) filesMatching("org/sablecc/sablecc/build.properties") { expand(version: project.version) } } // Run this task to regenerate the SableCC parser using itself. // The generated files are checked into Git, // to avoid bootstrapping problems, // so normally you do not need to run this task to build the parser. // If you change something in the parser generator or templates that affects the output, // please run this task manually and commit the updated generated files. tasks.register("regenerateParser", JavaExec) { final sableCCGrammar = file("src/main/sablecc/sablecc-3x.sablecc3") final outputDirs = [ "src/main/java/org/sablecc/sablecc/analysis", "src/main/java/org/sablecc/sablecc/lexer", "src/main/java/org/sablecc/sablecc/node", "src/main/java/org/sablecc/sablecc/parser", "src/main/resources/org/sablecc/sablecc/lexer", "src/main/resources/org/sablecc/sablecc/parser", ].collect {file(it)} inputs.file(sableCCGrammar) outputs.dir(temporaryDir) outputs.dirs(outputDirs) doFirst { delete(temporaryDir) mkdir(temporaryDir) } classpath(sourceSets.main.runtimeClasspath) mainClass = application.mainClass args = ["-d", temporaryDir, sableCCGrammar] doLast { delete(outputDirs) // Split the generated files - the .dat files go into resources, the .java files go into java. copy { from(temporaryDir) into("src/main/java") exclude("**/*.dat") } copy { from(temporaryDir) into("src/main/resources") include("**/*.dat") } } } jar { manifest { attributes([ 'Main-Class': application.mainClass.get(), 'Automatic-Module-Name': 'org.sablecc.sablecc', ]) } } publishing { publications { mavenJava(MavenPublication) { from components.java pom { name = 'SableCC - Stups fork' description = 'This version of SableCC enriches the abstract syntax tree with information about tokens.' url = 'https://gitlab.cs.uni-duesseldorf.de/general/stups/sablecc-stups' licenses { license { name = 'GNU Lesser General Public License, Version 2.1' url = 'http://www.gnu.org/licenses/lgpl-2.1.html' } } scm { connection = 'scm:git:https://gitlab.cs.uni-duesseldorf.de/general/stups/sablecc-stups.git' developerConnection = 'scm:git:git@gitlab.cs.uni-duesseldorf.de:general/stups/sablecc-stups.git' url = 'https://gitlab.cs.uni-duesseldorf.de/general/stups/sablecc-stups' } developers { developer { id = 'bendisposto' name = 'Jens Bendisposto' email = 'jens@bendisposto.de' } } } } } repositories { maven { final releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2" final snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots" url isSnapshot ? snapshotsRepoUrl : releasesRepoUrl if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) { credentials { username project.ossrhUsername password project.ossrhPassword } } } } } signing { sign publishing.publications.mavenJava }