Skip to content

Commit 1063b87

Browse files
committed
ant: Fall back to core directory
Signed-off-by: Ce Gao <[email protected]>
1 parent 1c6553e commit 1063b87

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed

build.xml.template

+8-6
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<property name="mode.name" value="RLangMode" />
44

55
<!-- folder to install modes in (probably a folder called "modes" inside your sketchbook folder) -->
6-
<property name="processing.modes" location="@@modes@@" />
6+
<property name="processing.modes" value="@@modes@@" />
77

88
<!-- path to your processing executable. -->
9-
<property name="processing.executable" location="@@executable@@" />
9+
<property name="processing.executable" value="@@executable@@" />
1010

1111
<!-- location of processing jars (core.jar, pde.jar, ..) -->
12-
<property name="processing.classes.core" location="@@core@@" />
13-
<property name="processing.classes.pde" location="@@pde@@" />
12+
<property name="processing.classes.core" value="@@core@@" />
13+
<property name="processing.classes.pde" value="@@pde@@" />
1414
<property name="renjin" value="@@renjin@@" />
1515
<property name="java.target.version" value="1.8" />
1616

@@ -30,8 +30,10 @@
3030
<property name="result.exec.file" location="${test.build.dir}/jacoco.exec"/>
3131

3232
<path id="library-classpath">
33-
<pathelement location="${processing.classes.core}"/>
3433
<pathelement location="${processing.classes.pde}"/>
34+
<fileset dir="${processing.classes.core}">
35+
<include name="*.jar" />
36+
</fileset>
3537
<fileset dir="lib">
3638
<include name="*.jar" />
3739
</fileset>
@@ -69,7 +71,7 @@
6971
<manifest>
7072
<attribute name="Main-Class" value="rprocessing.Runner" />
7173
</manifest>
72-
<zipgroupfileset file="${processing.classes.core}" includes="${processing.classes.core}" />
74+
<zipgroupfileset dir="${processing.classes.core}" includes="*.jar" />
7375
<zipgroupfileset dir="${lib}" includes="**/*.jar" />
7476
</jar>
7577
</target>

raw-docs/howto.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ Configure `./scripts/generate-ant-file.sh`:
3030
- MacOSX: `/Users/[MyUserName]/Documents/Processing/modes/`
3131
- Windows: `%homepath%\Documents\modes\`
3232
- Linux: `${HOME}/sketchbook/modes/`
33-
- `core` and `pde`: paths to pde.jar and core.jar. They are be used to build RLangMode.
34-
- MacOSX: `/Applications/Processing.app/Contents/Java/core.jar` and `/Applications/Processing.app/Contents/Java/pde.jar`
35-
- Linux: `[MyPDE]/core/library/core.jar` and `[MyPDE]/lib/pde.jar`
33+
- `core` and `pde`: paths to core library and pde.jar. They are be used to build runner and run test cases.
34+
- MacOSX: `/Applications/Processing.app/Contents/Java/core/library` and `/Applications/Processing.app/Contents/Java/pde.jar`
35+
- Linux: `[MyPDE]/core/library` and `[MyPDE]/lib/pde.jar`
3636
- `executable`: optional argument giving the location of PDE.
3737
- The path is used in `ant run` to start a PDE instance. Leave blank to not launch PDE on `ant run`.
3838
- MacOSX: `/Applications/Processing.app/Contents/MacOS/Processing`
@@ -44,8 +44,8 @@ For example, to install the mode into a default existing PDE app on a MacOS syst
4444

4545
```
4646
modes="/Users/[MyUserName]/Documents/Processing/modes"
47-
core="/Applications/Processing.app/Contents/Java/"
48-
pde="/Applications/Processing.app/Contents/Java/"
47+
core="/Applications/Processing.app/Contents/Java/core/library"
48+
pde="/Applications/Processing.app/Contents/Java/pde.jar"
4949
executable="/Applications/Processing.app/Contents/MacOS/Processing"
5050
```
5151

@@ -67,7 +67,7 @@ Then set the two paths accordingly in `./scripts/generate-ant-file.sh`:
6767
```
6868
modes="${HOME}/Documents/Processing/modes"
6969
core="../processing/core/library/"
70-
pde="../processing/app/"
70+
pde="../processing/app/pde.jar"
7171
executable="/Applications/Processing.app/Contents/MacOS/Processing"
7272
```
7373

scripts/generate-ant-file.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ source "$(dirname "${BASH_SOURCE}")/utils/generator-util.sh"
55
# Path to be changed
66
modes="${HOME}/Documents/Processing/modes"
77
executable="/Applications/Processing.app/Contents/MacOS/Processing"
8-
core="/Applications/Processing.app/Contents/Java/core.jar"
8+
core="/Applications/Processing.app/Contents/Java/core/library"
99
pde="/Applications/Processing.app/Contents/Java/pde.jar"
1010

1111
# Call functions in utils/generator-util.sh

scripts/utils/generator-util.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ function log {
99
}
1010

1111
function help {
12-
log "There are 4 paths needed: mode directory, path to executable, path to core.jar, and path to pde.jar."
12+
log "There are 4 paths needed: mode directory, path to executable, path to core.jar directory and path to pde.jar."
1313
}
1414

1515
function generate-build-config {
16+
local numberOfParams=4
1617
local root=$(dirname "${BASH_SOURCE}")/../..
1718

18-
if [[ $# -ne 4 ]]; then
19+
if [[ $# -ne ${numberOfParams} ]]; then
1920
log "The number of parameters is $#, which does not match ${FUNCNAME} in ${BASH_SOURCE}."
2021
help
2122
exit 1

0 commit comments

Comments
 (0)