mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-21 15:54:39 +01:00
Introducing APP_DIR property. Allows the IDE to know its installation folder.
Also upgrading appbundler with a patched version: https://bitbucket.org/ffissore/appbundler It allows to know the current working directory These two put together, we can now rely on APP_DIR when loading IDE resources while being sure current working directory is properly set, thus being much more friendly when run from CLI Fixes #1493
This commit is contained in:
parent
1d8fbd4b5d
commit
85ae80b6f9
4
.gitignore
vendored
4
.gitignore
vendored
@ -33,8 +33,8 @@ build/macosx/libastylej*
|
|||||||
build/macosx/appbundler*.jar
|
build/macosx/appbundler*.jar
|
||||||
build/macosx/appbundler*.zip
|
build/macosx/appbundler*.zip
|
||||||
build/macosx/appbundler
|
build/macosx/appbundler
|
||||||
build/macosx/appbundler-1.0ea-arduino2
|
build/macosx/appbundler-1.0ea-arduino*.zip
|
||||||
build/macosx/appbundler-1.0ea-upstream1
|
build/macosx/appbundler-1.0ea-upstream*.zip
|
||||||
build/linux/work/
|
build/linux/work/
|
||||||
build/linux/dist/*.tar.gz
|
build/linux/dist/*.tar.gz
|
||||||
build/linux/dist/*.tar.bz2
|
build/linux/dist/*.tar.bz2
|
||||||
|
@ -186,21 +186,8 @@ public class BaseNoGui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static public File getContentFile(String name) {
|
static public File getContentFile(String name) {
|
||||||
File path = new File(System.getProperty("user.dir"));
|
File installationFolder = new File(System.getProperty("APP_DIR"));
|
||||||
|
return new File(installationFolder, name);
|
||||||
if (OSUtils.isMacOS()) {
|
|
||||||
if (System.getProperty("WORK_DIR") != null) {
|
|
||||||
path = new File(System.getProperty("WORK_DIR"));
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
path = new File(BaseNoGui.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).getParentFile();
|
|
||||||
} catch (URISyntaxException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new File(path, name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static public TargetPlatform getCurrentTargetPlatformFromPackage(String pack) {
|
static public TargetPlatform getCurrentTargetPlatformFromPackage(String pack) {
|
||||||
|
@ -305,16 +305,17 @@
|
|||||||
<mkdir dir="${staging_folder}/work" />
|
<mkdir dir="${staging_folder}/work" />
|
||||||
|
|
||||||
<antcall target="unzip">
|
<antcall target="unzip">
|
||||||
<param name="archive_file" value="${staging_folder}/appbundler-1.0ea-upstream1.jar.zip" />
|
<param name="archive_file" value="${staging_folder}/appbundler-1.0ea-arduino3.jar.zip" />
|
||||||
<param name="archive_url" value="http://downloads.arduino.cc/appbundler-1.0ea-upstream1.jar.zip" />
|
<param name="archive_url" value="http://downloads.arduino.cc/appbundler-1.0ea-arduino3.jar.zip" />
|
||||||
<param name="final_folder" value="${staging_folder}/appbundler-1.0ea-upstream1" />
|
<param name="final_folder" value="${staging_folder}/appbundler-1.0ea-arduino3" />
|
||||||
<param name="dest_folder" value="${staging_folder}/appbundler-1.0ea-upstream1" />
|
<param name="dest_folder" value="${staging_folder}/appbundler-1.0ea-arduino3" />
|
||||||
</antcall>
|
</antcall>
|
||||||
|
|
||||||
<taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="${staging_folder}/appbundler-1.0ea-upstream1/appbundler-1.0ea-upstream1.jar"/>
|
<taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask" classpath="${staging_folder}/appbundler-1.0ea-arduino3/appbundler-1.0ea-arduino3.jar"/>
|
||||||
|
|
||||||
<bundleapp
|
<bundleapp
|
||||||
jvmRequired="1.8"
|
jvmRequired="1.8"
|
||||||
|
jrepreferred="true"
|
||||||
outputdirectory="${staging_folder}/work"
|
outputdirectory="${staging_folder}/work"
|
||||||
name="Arduino"
|
name="Arduino"
|
||||||
displayname="Arduino"
|
displayname="Arduino"
|
||||||
@ -326,6 +327,7 @@
|
|||||||
icon="macosx/template.app/Contents/Resources/processing.icns"
|
icon="macosx/template.app/Contents/Resources/processing.icns"
|
||||||
mainclassname="processing.app.Base"
|
mainclassname="processing.app.Base"
|
||||||
copyright="Arduino LLC"
|
copyright="Arduino LLC"
|
||||||
|
applicationCategory="public.app-category.education"
|
||||||
minimumsystemversion="10.7"
|
minimumsystemversion="10.7"
|
||||||
highresolutioncapable="true">
|
highresolutioncapable="true">
|
||||||
|
|
||||||
@ -336,11 +338,12 @@
|
|||||||
|
|
||||||
<classpath refid="runtime.jars"/>
|
<classpath refid="runtime.jars"/>
|
||||||
|
|
||||||
<option value="-Dapple.awt.application.name=Arduino" />
|
<option value="-Dapple.awt.application.name=Arduino"/>
|
||||||
<option value="-Dapple.laf.useScreenMenuBar=true"/>
|
<option value="-Dapple.laf.useScreenMenuBar=true"/>
|
||||||
<option value="-Dcom.apple.macos.use-file-dialog-packages=true"/>
|
<option value="-Dcom.apple.macos.use-file-dialog-packages=true"/>
|
||||||
<option value="-Dcom.apple.smallTabs=true"/>
|
<option value="-Dcom.apple.smallTabs=true"/>
|
||||||
<option value="-Dcom.apple.macos.useScreenMenuBar=true" />
|
<option value="-Dcom.apple.macos.useScreenMenuBar=true"/>
|
||||||
|
<option value="-DAPP_DIR=$APP_ROOT/Contents/Java"/>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<option value="-Dapple.awt.showGrowBox=false"/>
|
<option value="-Dapple.awt.showGrowBox=false"/>
|
||||||
|
3
build/linux/dist/arduino
vendored
3
build/linux/dist/arduino
vendored
@ -33,4 +33,5 @@ if [ -x ./java/bin/java ]; then
|
|||||||
JAVA=./java/bin/java
|
JAVA=./java/bin/java
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$JAVA -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel $SPLASH processing.app.Base --curdir "$CURDIR" "$@"
|
$JAVA -DAPP_DIR="$APPDIR" -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel $SPLASH processing.app.Base --curdir "$CURDIR" "$@"
|
||||||
|
|
||||||
|
1
build/macosx/appbundler-1.0ea-arduino3.jar.zip.sha
Normal file
1
build/macosx/appbundler-1.0ea-arduino3.jar.zip.sha
Normal file
@ -0,0 +1 @@
|
|||||||
|
247d19a71672171ce2eda25704121375f04c5e1f
|
@ -1 +0,0 @@
|
|||||||
5bb6377a65edf7af7b5b3820711bab0e377bdee1
|
|
@ -3,43 +3,43 @@
|
|||||||
<headerType>gui</headerType>
|
<headerType>gui</headerType>
|
||||||
<jar>lib</jar>
|
<jar>lib</jar>
|
||||||
<outfile>arduino.exe</outfile>
|
<outfile>arduino.exe</outfile>
|
||||||
<chdir>.</chdir>
|
|
||||||
<errTitle>Arduino</errTitle>
|
<errTitle>Arduino</errTitle>
|
||||||
<downloadUrl>http://www.oracle.com/technetwork/java/javase/downloads/index.html</downloadUrl>
|
<downloadUrl>http://www.oracle.com/technetwork/java/javase/downloads/index.html</downloadUrl>
|
||||||
<icon>application.ico</icon>
|
<icon>application.ico</icon>
|
||||||
<classPath>
|
<classPath>
|
||||||
<mainClass>processing.app.Base</mainClass>
|
<mainClass>processing.app.Base</mainClass>
|
||||||
<cp>lib/antlr.jar</cp>
|
<cp>%EXEDIR%/lib/antlr.jar</cp>
|
||||||
<cp>lib/apple.jar</cp>
|
<cp>%EXEDIR%/lib/apple.jar</cp>
|
||||||
<cp>lib/arduino-core.jar</cp>
|
<cp>%EXEDIR%/lib/arduino-core.jar</cp>
|
||||||
<cp>lib/bcpg-jdk15on-152.jar</cp>
|
<cp>%EXEDIR%/lib/bcpg-jdk15on-152.jar</cp>
|
||||||
<cp>lib/bcprov-jdk15on-152.jar</cp>
|
<cp>%EXEDIR%/lib/bcprov-jdk15on-152.jar</cp>
|
||||||
<cp>lib/commons-codec-1.7.jar</cp>
|
<cp>%EXEDIR%/lib/commons-codec-1.7.jar</cp>
|
||||||
<cp>lib/commons-compress-1.8.jar</cp>
|
<cp>%EXEDIR%/lib/commons-compress-1.8.jar</cp>
|
||||||
<cp>lib/commons-exec-1.1.jar</cp>
|
<cp>%EXEDIR%/lib/commons-exec-1.1.jar</cp>
|
||||||
<cp>lib/commons-httpclient-3.1.jar</cp>
|
<cp>%EXEDIR%/lib/commons-httpclient-3.1.jar</cp>
|
||||||
<cp>lib/commons-lang3-3.3.2.jar</cp>
|
<cp>%EXEDIR%/lib/commons-lang3-3.3.2.jar</cp>
|
||||||
<cp>lib/commons-logging-1.0.4.jar</cp>
|
<cp>%EXEDIR%/lib/commons-logging-1.0.4.jar</cp>
|
||||||
<cp>lib/ecj.jar</cp>
|
<cp>%EXEDIR%/lib/ecj.jar</cp>
|
||||||
<cp>lib/guava-18.0.jar</cp>
|
<cp>%EXEDIR%/lib/guava-18.0.jar</cp>
|
||||||
<cp>lib/jackson-annotations-2.2.3.jar</cp>
|
<cp>%EXEDIR%/lib/jackson-annotations-2.2.3.jar</cp>
|
||||||
<cp>lib/jackson-core-2.2.3.jar</cp>
|
<cp>%EXEDIR%/lib/jackson-core-2.2.3.jar</cp>
|
||||||
<cp>lib/jackson-databind-2.2.3.jar</cp>
|
<cp>%EXEDIR%/lib/jackson-databind-2.2.3.jar</cp>
|
||||||
<cp>lib/jackson-module-mrbean-2.2.3.jar</cp>
|
<cp>%EXEDIR%/lib/jackson-module-mrbean-2.2.3.jar</cp>
|
||||||
<cp>lib/java-semver-0.8.0.jar</cp>
|
<cp>%EXEDIR%/lib/java-semver-0.8.0.jar</cp>
|
||||||
<cp>lib/jmdns-3.4.1.jar</cp>
|
<cp>%EXEDIR%/lib/jmdns-3.4.1.jar</cp>
|
||||||
<cp>lib/jna-4.1.0.jar</cp>
|
<cp>%EXEDIR%/lib/jna-4.1.0.jar</cp>
|
||||||
<cp>lib/jna-platform-4.1.0.jar</cp>
|
<cp>%EXEDIR%/lib/jna-platform-4.1.0.jar</cp>
|
||||||
<cp>lib/jsch-0.1.50.jar</cp>
|
<cp>%EXEDIR%/lib/jsch-0.1.50.jar</cp>
|
||||||
<cp>lib/jssc-2.8.0.jar</cp>
|
<cp>%EXEDIR%/lib/jssc-2.8.0.jar</cp>
|
||||||
<cp>lib/pde.jar</cp>
|
<cp>%EXEDIR%/lib/pde.jar</cp>
|
||||||
<cp>lib/rsyntaxtextarea-2.5.6.1+arduino.jar</cp>
|
<cp>%EXEDIR%/lib/rsyntaxtextarea-2.5.6.1+arduino.jar</cp>
|
||||||
</classPath>
|
</classPath>
|
||||||
<jre>
|
<jre>
|
||||||
<path>java</path>
|
<path>java</path>
|
||||||
<runtimeBits>32</runtimeBits>
|
<runtimeBits>32</runtimeBits>
|
||||||
<opt>-splash:./lib/splash.png</opt>
|
<opt>-splash:%EXEDIR%/lib/splash.png</opt>
|
||||||
<opt>-Dsun.java2d.d3d=false</opt>
|
<opt>-Dsun.java2d.d3d=false</opt>
|
||||||
|
<opt>-DAPP_DIR="%EXEDIR%"</opt>
|
||||||
</jre>
|
</jre>
|
||||||
<versionInfo>
|
<versionInfo>
|
||||||
<fileDescription>Arduino IDE</fileDescription>
|
<fileDescription>Arduino IDE</fileDescription>
|
||||||
|
@ -3,42 +3,42 @@
|
|||||||
<headerType>console</headerType>
|
<headerType>console</headerType>
|
||||||
<jar>lib</jar>
|
<jar>lib</jar>
|
||||||
<outfile>arduino_debug.exe</outfile>
|
<outfile>arduino_debug.exe</outfile>
|
||||||
<chdir>.</chdir>
|
|
||||||
<errTitle>Arduino</errTitle>
|
<errTitle>Arduino</errTitle>
|
||||||
<downloadUrl>http://www.oracle.com/technetwork/java/javase/downloads/index.html</downloadUrl>
|
<downloadUrl>http://www.oracle.com/technetwork/java/javase/downloads/index.html</downloadUrl>
|
||||||
<icon>application.ico</icon>
|
<icon>application.ico</icon>
|
||||||
<classPath>
|
<classPath>
|
||||||
<mainClass>processing.app.Base</mainClass>
|
<mainClass>processing.app.Base</mainClass>
|
||||||
<cp>lib/antlr.jar</cp>
|
<cp>%EXEDIR%/lib/antlr.jar</cp>
|
||||||
<cp>lib/apple.jar</cp>
|
<cp>%EXEDIR%/lib/apple.jar</cp>
|
||||||
<cp>lib/arduino-core.jar</cp>
|
<cp>%EXEDIR%/lib/arduino-core.jar</cp>
|
||||||
<cp>lib/bcpg-jdk15on-152.jar</cp>
|
<cp>%EXEDIR%/lib/bcpg-jdk15on-152.jar</cp>
|
||||||
<cp>lib/bcprov-jdk15on-152.jar</cp>
|
<cp>%EXEDIR%/lib/bcprov-jdk15on-152.jar</cp>
|
||||||
<cp>lib/commons-codec-1.7.jar</cp>
|
<cp>%EXEDIR%/lib/commons-codec-1.7.jar</cp>
|
||||||
<cp>lib/commons-compress-1.8.jar</cp>
|
<cp>%EXEDIR%/lib/commons-compress-1.8.jar</cp>
|
||||||
<cp>lib/commons-exec-1.1.jar</cp>
|
<cp>%EXEDIR%/lib/commons-exec-1.1.jar</cp>
|
||||||
<cp>lib/commons-httpclient-3.1.jar</cp>
|
<cp>%EXEDIR%/lib/commons-httpclient-3.1.jar</cp>
|
||||||
<cp>lib/commons-lang3-3.3.2.jar</cp>
|
<cp>%EXEDIR%/lib/commons-lang3-3.3.2.jar</cp>
|
||||||
<cp>lib/commons-logging-1.0.4.jar</cp>
|
<cp>%EXEDIR%/lib/commons-logging-1.0.4.jar</cp>
|
||||||
<cp>lib/ecj.jar</cp>
|
<cp>%EXEDIR%/lib/ecj.jar</cp>
|
||||||
<cp>lib/guava-18.0.jar</cp>
|
<cp>%EXEDIR%/lib/guava-18.0.jar</cp>
|
||||||
<cp>lib/jackson-annotations-2.2.3.jar</cp>
|
<cp>%EXEDIR%/lib/jackson-annotations-2.2.3.jar</cp>
|
||||||
<cp>lib/jackson-core-2.2.3.jar</cp>
|
<cp>%EXEDIR%/lib/jackson-core-2.2.3.jar</cp>
|
||||||
<cp>lib/jackson-databind-2.2.3.jar</cp>
|
<cp>%EXEDIR%/lib/jackson-databind-2.2.3.jar</cp>
|
||||||
<cp>lib/jackson-module-mrbean-2.2.3.jar</cp>
|
<cp>%EXEDIR%/lib/jackson-module-mrbean-2.2.3.jar</cp>
|
||||||
<cp>lib/java-semver-0.8.0.jar</cp>
|
<cp>%EXEDIR%/lib/java-semver-0.8.0.jar</cp>
|
||||||
<cp>lib/jmdns-3.4.1.jar</cp>
|
<cp>%EXEDIR%/lib/jmdns-3.4.1.jar</cp>
|
||||||
<cp>lib/jna-4.1.0.jar</cp>
|
<cp>%EXEDIR%/lib/jna-4.1.0.jar</cp>
|
||||||
<cp>lib/jna-platform-4.1.0.jar</cp>
|
<cp>%EXEDIR%/lib/jna-platform-4.1.0.jar</cp>
|
||||||
<cp>lib/jsch-0.1.50.jar</cp>
|
<cp>%EXEDIR%/lib/jsch-0.1.50.jar</cp>
|
||||||
<cp>lib/jssc-2.8.0.jar</cp>
|
<cp>%EXEDIR%/lib/jssc-2.8.0.jar</cp>
|
||||||
<cp>lib/pde.jar</cp>
|
<cp>%EXEDIR%/lib/pde.jar</cp>
|
||||||
<cp>lib/rsyntaxtextarea-2.5.6.1+arduino.jar</cp>
|
<cp>%EXEDIR%/lib/rsyntaxtextarea-2.5.6.1+arduino.jar</cp>
|
||||||
</classPath>
|
</classPath>
|
||||||
<jre>
|
<jre>
|
||||||
<path>java</path>
|
<path>java</path>
|
||||||
<runtimeBits>32</runtimeBits>
|
<runtimeBits>32</runtimeBits>
|
||||||
<opt>-Dsun.java2d.d3d=false</opt>
|
<opt>-Dsun.java2d.d3d=false</opt>
|
||||||
|
<opt>-DAPP_DIR="%EXEDIR%"</opt>
|
||||||
</jre>
|
</jre>
|
||||||
<versionInfo>
|
<versionInfo>
|
||||||
<fileDescription>Arduino IDE</fileDescription>
|
<fileDescription>Arduino IDE</fileDescription>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user