Skip to content

Commit 42fa0fa

Browse files
committed
adding a rascal maven plugin for building rascal modules
1 parent a8400a4 commit 42fa0fa

File tree

3 files changed

+34
-3
lines changed

3 files changed

+34
-3
lines changed

META-INF/RASCAL.MF

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ Project-Name: JimpleFramework
44
Courses: courses
55
Main-Module: Plugin
66
Source: src/main/rascal,src/test/rascal
7+
Require-Libraries: |lib://rascal_eclipse|

pom.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@
2727
<artifactId>rascal</artifactId>
2828
<version>0.18.0</version>
2929
</dependency>
30+
3031
<dependency>
3132
<groupId>junit</groupId>
3233
<artifactId>junit</artifactId>
3334
<version>4.13.1</version>
3435
<scope>test</scope>
3536
</dependency>
37+
3638
<dependency>
3739
<groupId>org.projectlombok</groupId>
3840
<artifactId>lombok</artifactId>
@@ -53,6 +55,34 @@
5355
<target>1.8</target>
5456
</configuration>
5557
</plugin>
58+
59+
<plugin>
60+
<groupId>org.rascalmpl</groupId>
61+
<artifactId>rascal-maven-plugin</artifactId>
62+
<version>0.3.4</version>
63+
<configuration>
64+
<bin>${project.build.outputDirectory}</bin>
65+
<errorsAsWarnings>true</errorsAsWarnings>
66+
<enableStandardLibrary>true</enableStandardLibrary>
67+
<srcs>
68+
<src>${project.basedir}/src/main/rascal</src>
69+
</srcs>
70+
<srcIgnores>
71+
<ignore>${project.basedir}/src/main/rascal/lang/jimple/toolkit/GraphUtil.rsc</ignore>
72+
<ignore>${project.basedir}/src/main/rascal/lang/jimple/toolkit/CallGraph.rsc</ignore>
73+
</srcIgnores>
74+
</configuration>
75+
<executions>
76+
<execution>
77+
<id>it-compile</id>
78+
<phase>compile</phase>
79+
<goals>
80+
<goal>compile</goal>
81+
</goals>
82+
</execution>
83+
</executions>
84+
</plugin>
85+
5686
</plugins>
5787
</build>
5888

src/main/rascal/lang/jimple/util/JPrettyPrinter.rsc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ public str prettyPrint(list[Type] types, str n) {
240240
return text;
241241
}
242242
243-
public str prettyPrint(Field f: field(modifiers, fieldType, name)) =
243+
public str prettyPrint(Field::field(modifiers, fieldType, name)) =
244244
"<prettyPrint(modifiers)> <prettyPrint(fieldType)> <name>;";
245245
246246
public str prettyPrint(list[Field] fields) =
@@ -251,15 +251,15 @@ public str prettyPrint(list[Field] fields) =
251251
public str prettyPrint(LocalVariableDeclaration::localVariableDeclaration(Type varType, Identifier local)) =
252252
"<prettyPrint(varType)> <local>;";
253253
254-
public str prettyPrint(MethodBody body: methodBody(localVars, stmts, catchClauses)) =
254+
public str prettyPrint(MethodBody::methodBody(localVars, stmts, catchClauses)) =
255255
"<for(l <- localVars){>
256256
' <prettyPrint(l)><}>
257257
'<for(s <- stmts){>
258258
'<if (s is label) {>
259259
'<prettyPrint(s)><} else {>
260260
' <prettyPrint(s)><}><}> <for(c <- catchClauses){>\n <prettyPrint(c)><}>";
261261
262-
public str prettyPrint(Method m: method(modifiers, returnType, name, formals, exceptions, body)) =
262+
public str prettyPrint(Method::method(modifiers, returnType, name, formals, exceptions, body)) =
263263
"<prettyPrint(modifiers)> <prettyPrint(returnType)> <name>(<prettyPrint(formals,"")>) <prettyPrint(exceptions,"throws ")>
264264
'{<prettyPrint(body)>
265265
'}

0 commit comments

Comments
 (0)