Skip to content
Snippets Groups Projects
Commit e6d41f70 authored by dgelessus's avatar dgelessus
Browse files

Merge branch 'release/3.3.0'

parents ca5ca990 9a1daf97
Branches
Tags 3.3.0
No related merge requests found
Pipeline #39981 passed
Showing
with 88 additions and 106 deletions
......@@ -4,17 +4,19 @@ apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'signing'
allprojects {
project.group = 'de.hhu.stups'
project.version = '3.3.0'
project.ext.isSnapshot = project.version.endsWith("-SNAPSHOT")
project.version = '3.2.14'
project.group = 'de.hhu.stups'
ext."signing.secretKeyRingFile" = rootProject.file("secring.gpg").absolutePath
}
wrapper {
gradleVersion = "6.3"
distributionType = Wrapper.DistributionType.ALL
}
final isSnapshot = project.version.endsWith("-SNAPSHOT")
sourceCompatibility = 7
targetCompatibility = 7
......@@ -38,7 +40,10 @@ processResources {
jar {
manifest {
attributes 'Main-Class': mainClassName
attributes([
'Main-Class': mainClassName,
'Automatic-Module-Name': 'org.sablecc.sablecc',
])
}
}
......
U2FsdGVkX1+772WWsEs8y4Z+vdhQLZyW24cH/04lX8CxgZ4JycDLZWPBAc70ZGyT
w1lgwUF18NmTGDpjwyDkUQmXdYUHYRGUCLTeNays57gOaxEVQQz0zm0kKAISdnNW
9IgD8BI/lbftz7Y8dqxMUBxfcUTijzJfXz+uEK53jwBoxKYVznzzCCfwEv+1KMR9
oypMpm9HRBMEZyDkPRPJ2DKOFhW6YCdcszCjTNKmeJkOwVjfyltC43WXzcrzYKR/
S2pGjR+7mcBg9zq0yMI+1DgMWwmrAaLP9pKnyDqDgXK1yJIKKE80C4NkJN6XVhHc
qjWQ8xnLXRorA7j0lkWAhw==
U2FsdGVkX18nOHLNyyzYk3lwSF0IGgXp8ubFJuMWOPaMbTBmgRPWS/jQT4LO17HP
W5yqIb+NzcYqzLBohg9s9r4XFyoS5ic3TIyPp87IXzgWNh3gKV+F+DfbggwMjiyJ
0gZI+90cmkWXBDW7c3JijLOX2f0NATwuiwHFPau3FCKC0cp7uOArtqkbfZau2how
oP8hzzAue50fahPuBfg8h3OtofJW9x9UCUxxD/NXzD8VZFQabICUjI8mcjEcvaea
MqQn9JuoekIRPDUsUwZ9Er07OkzKXHB5c968S3DUP3w=
plugins {
id "java-library"
id "maven-publish"
id "signing"
}
java {
sourceCompatibility = JavaVersion.VERSION_1_7
withSourcesJar()
withJavadocJar()
}
jar {
manifest {
attributes([
"Automatic-Module-Name": "de.hhu.stups.sablecc.patch",
])
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'SableCC - Stups fork (runtime library)'
description = 'This is the runtime support library for the Stups fork of SableCC. It provides common classes and interfaces used by the generated parsers at runtime.'
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
}
rootProject.name = "sablecc"
include "sablecc-runtime"
......@@ -113,33 +113,6 @@ public class SableCC {
}
}
/*
* extract additional stups-classes from .jar-file
*/
String generated = ".";
boolean found = false;
for (String p : arguments) {
if (found) {
generated = p;
break;
}
if ("-d".equals(p)) {
found = true;
}
}
String patchFolder = generated + "/de/hhu/stups/sablecc/patch";
String[] patchFiles = { "IParser", "IToken", "ITokenListContainer",
"PositionedNode", "SourcePosition", "SourcePositions",
"SourcecodeRange" };
new File(patchFolder).mkdirs();
for (String f : patchFiles) {
extractPatchFile(patchFolder, f);
}
try {
for (int i = 0; i < filename.size(); i++) {
processGrammar((String) filename.elementAt(i), d_option);
......@@ -151,74 +124,6 @@ public class SableCC {
System.exit(0);
}
private static void extractPatchFile(String patchFolder, String patchFile) {
ClassLoader loader = SableCC.class.getClassLoader();
InputStream input = loader.getResourceAsStream("patchfiles/"
+ patchFile + ".txt");
String output = "";
String outputFile = patchFolder + "/" + patchFile + ".java";
try {
output = convertStreamToString(input);
} catch (IOException e) {
e.printStackTrace();
System.exit(1);
}
Writer writer = null;
try {
File file = new File(outputFile);
writer = new BufferedWriter(new FileWriter(file));
writer.write(output);
} catch (FileNotFoundException e) {
e.printStackTrace();
System.exit(1);
} catch (IOException e) {
e.printStackTrace();
System.exit(1);
} finally {
try {
if (writer != null) {
writer.close();
}
} catch (IOException e) {
e.printStackTrace();
System.exit(1);
}
}
}
private static String convertStreamToString(InputStream is)
throws IOException {
/*
* To convert the InputStream to String we use the Reader.read(char[]
* buffer) method. We iterate until the Reader return -1 which means
* there's no more data to read. We use the StringWriter class to
* produce the string.
*/
if (is != null) {
Writer writer = new StringWriter();
char[] buffer = new char[1024];
try {
Reader reader = new BufferedReader(new InputStreamReader(is,
"UTF-8"));
int n;
while ((n = reader.read(buffer)) != -1) {
writer.write(buffer, 0, n);
}
} finally {
is.close();
}
return writer.toString();
} else {
return "";
}
}
/**
* The main method for processing grammar file and generating the
* parser/lexer.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment