-
Notifications
You must be signed in to change notification settings - Fork 1
/
pom-v5.xml
168 lines (163 loc) · 6.76 KB
/
pom-v5.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.nlogo.extensions.dbscan</groupId>
<artifactId>dbscan</artifactId>
<version>0.4</version>
<relativePath>pom-root.xml</relativePath>
</parent>
<groupId>org.nlogo.extensions.dbscan</groupId>
<artifactId>dbscan-NetLogo5</artifactId>
<version>0.4</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>NetLogo</groupId>
<artifactId>NetLogoLite</artifactId>
<version>5.3.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<executions>
<!-- Prevent test compilation as of considerable API differences (automated testing done only on latest supported API) -->
<execution>
<id>default-testCompile</id>
<phase>test-compile</phase>
<configuration>
<testExcludes>
<exclude>**/TestNetLogoDBSCAN.java</exclude>
</testExcludes>
</configuration>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Make copy of source files (and recovery afterwards) before applying syntax changes to accommodate NetLogo Extensions API v5 -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>replace-source-file</id>
<phase>generate-sources</phase>
<configuration>
<tasks>
<copy file="src/main/java/org/nlogo/extensions/dbscan/DBSCANExtension.java" tofile="tmp/DBSCANExtension.bak"/>
<!-- <copy file="src/test/java/org/nlogo/extensions/dbscan/TestNetLogoDBSCAN.java" tofile="tmp/TestNetLogoDBSCAN.bak"/> -->
<copy file="src/main/resources/manifest.txt" tofile="tmp/manifest.bak"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>restore-source-file</id>
<phase>package</phase>
<configuration>
<tasks>
<move file="tmp/DBSCANExtension.bak" tofile="src/main/java/org/nlogo/extensions/dbscan/DBSCANExtension.java"/>
<!-- <move file="tmp/TestNetLogoDBSCAN.bak" tofile="src/test/java/org/nlogo/extensions/dbscan/TestNetLogoDBSCAN.java"/> -->
<move file="tmp/manifest.bak" tofile="src/main/resources/manifest.txt"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Replacing syntax to accommodate NetLogo Extensions API v5 -->
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.3</version>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>${basedir}/src/main/java/org/nlogo/extensions/dbscan/DBSCANExtension.java</include>
<!-- <include>${basedir}/src/test/java/org/nlogo/extensions/dbscan/TestNetLogoDBSCAN.java</include> -->
<include>${basedir}/src/main/resources/manifest.txt</include>
</includes>
<replacements>
<replacement>
<token>((NetLogo-Extension-API-Version:)(.)*)</token>
<value>NetLogo-Extension-API-Version: 5.0</value>
</replacement>
<replacement>
<token>import org.nlogo.api.Reporter;</token>
<value>import org.nlogo.api.DefaultReporter;</value>
</replacement>
<replacement>
<token>import org.nlogo.core.Syntax;</token>
<value>import org.nlogo.api.Syntax;</value>
</replacement>
<replacement>
<token>import org.nlogo.core.SyntaxJ;</token>
<value></value>
</replacement>
<replacement>
<token>import org.nlogo.core.WorldDimensions;</token>
<value>import org.nlogo.api.World;</value>
</replacement>
<replacement>
<token>ctx == null \|\| ctx.world\(\) == null</token>
<value>ctx == null</value>
</replacement>
<replacement>
<token>WorldDimensions dim = ctx.world\(\).getDimensions\(\);</token>
<value>World dim = ((org.nlogo.api.Agent)first).world();</value>
</replacement>
<replacement>
<token>dim.height\(\);</token>
<value>dim.worldHeight();</value>
</replacement>
<replacement>
<token>new DistanceMetricNetLogoAgentLocationTorus\(dim.width\(\), dim.height\(\)\) :</token>
<value>new DistanceMetricNetLogoAgentLocationTorus(dim.worldWidth(), dim.worldHeight()) :</value>
</replacement>
<replacement>
<token>new DistanceMetricNetLogoAgentLocationVerticalCylinder\(dim.width\(\)\) :</token>
<value>new DistanceMetricNetLogoAgentLocationVerticalCylinder(dim.worldWidth()) :</value>
</replacement>
<replacement>
<token>new DistanceMetricNetLogoAgentLocationHorizontalCylinder\(dim.height\(\)\) :</token>
<value>new DistanceMetricNetLogoAgentLocationHorizontalCylinder(dim.worldHeight()) :</value>
</replacement>
<replacement>
<token>SyntaxJ.reporterSyntax</token>
<value>Syntax.reporterSyntax</value>
</replacement>
<replacement>
<token>inputValues.isEmpty\(\)</token>
<value>inputValues.count() == 0</value>
</replacement>
<replacement>
<token>fieldIndex = ctx.world\(\).program\(\).patchesOwn\(\).toList\(\).indexOf\(field.toUpperCase\(\)\);</token>
<value>fieldIndex = -2;</value>
</replacement>
<replacement>
<token>implements Reporter</token>
<value>extends DefaultReporter</value>
</replacement>
</replacements>
</configuration>
</plugin>
</plugins>
</build>
</project>