From 65ff4981a7d406544f36d68fd8e4312eb4311309 Mon Sep 17 00:00:00 2001 From: dgelessus <dgelessus@users.noreply.github.com> Date: Wed, 6 Mar 2019 14:50:09 +0100 Subject: [PATCH] Add .editorconfig and indent build.gradle consistently --- .editorconfig | 7 +++ build.gradle | 118 +++++++++++++++++++++++++------------------------- 2 files changed, 66 insertions(+), 59 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a45db48 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +charset = utf-8 +insert_final_newline = true diff --git a/build.gradle b/build.gradle index 11cac11..2e68806 100644 --- a/build.gradle +++ b/build.gradle @@ -8,55 +8,55 @@ project.group = 'de.hhu.stups' project.archivesBaseName = "sablecc" wrapper { - gradleVersion = "5.2.1" - distributionType = Wrapper.DistributionType.ALL + gradleVersion = "5.2.1" + distributionType = Wrapper.DistributionType.ALL } allprojects { - sourceCompatibility = 1.6 - targetCompatibility = 1.6 + sourceCompatibility = 1.6 + targetCompatibility = 1.6 } dependencies { - testCompile 'junit:junit:4.8.2' + testCompile 'junit:junit:4.8.2' } task javadocJar(type: Jar) { - classifier = 'javadoc' - from javadoc + classifier = 'javadoc' + from javadoc } task sourcesJar(type: Jar) { - classifier = 'sources' - from sourceSets.main.allSource + classifier = 'sources' + from sourceSets.main.allSource } jar { - manifest { - attributes 'Main-Class': 'org.sablecc.sablecc.SableCC' - } + manifest { + attributes 'Main-Class': 'org.sablecc.sablecc.SableCC' + } } artifacts { - archives javadocJar, sourcesJar + archives javadocJar, sourcesJar } task writeVersion() { doFirst { - def buildconstants_class = """ - package org.sablecc.sablecc; + def buildconstants_class = """ +package org.sablecc.sablecc; - public class Version - { - public static final String VERSION = "${project.version}"; +public class Version +{ + public static final String VERSION = "${project.version}"; +} + """ + File f = file("src/main/java/org/sablecc/sablecc/Version.java") + f.delete() + f << buildconstants_class } - """ - File f = file("src/main/java/org/sablecc/sablecc/Version.java") - f.delete() - f << buildconstants_class - } } compileJava { @@ -67,54 +67,54 @@ task deploy(dependsOn: [jar,test,javadoc], group: 'Build') if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) { -apply plugin: 'signing' + apply plugin: 'signing' -signing { + signing { sign configurations.archives -} -uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication(userName: ossrhUsername, password: ossrhPassword) - } + } + uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - authentication(userName: ossrhUsername, password: ossrhPassword) - } + repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { + authentication(userName: ossrhUsername, password: ossrhPassword) + } - pom.project { - name 'SableCC - Stups fork' - packaging 'jar' - // optionally artifactId can be defined here - description 'This version of SableCC enriches the abstract syntax tree with information about tokens.' - url 'https://github.com/bendisposto/sablecc-stups' - - licenses { - license { - name 'GNU Lesser General Public License, Version 2.1' - url 'http://www.gnu.org/licenses/lgpl-2.1.html' - } + snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { + authentication(userName: ossrhUsername, password: ossrhPassword) } - scm { - connection 'scm:git:git://github.com/bendisposto/sablecc-stups.git' - developerConnection 'scm:git:git@github.com:bendisposto/sablecc-stups.git' + pom.project { + name 'SableCC - Stups fork' + packaging 'jar' + // optionally artifactId can be defined here + description 'This version of SableCC enriches the abstract syntax tree with information about tokens.' url 'https://github.com/bendisposto/sablecc-stups' - } + licenses { + license { + name 'GNU Lesser General Public License, Version 2.1' + url 'http://www.gnu.org/licenses/lgpl-2.1.html' + } + } - developers { - developer { - id 'bendisposto' - name 'Jens Bendisposto' - email 'jens@bendisposto.de' + scm { + connection 'scm:git:git://github.com/bendisposto/sablecc-stups.git' + developerConnection 'scm:git:git@github.com:bendisposto/sablecc-stups.git' + url 'https://github.com/bendisposto/sablecc-stups' + } + + + developers { + developer { + id 'bendisposto' + name 'Jens Bendisposto' + email 'jens@bendisposto.de' + } } } } } } } -} -- GitLab