-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- various assemble tasks work again; - upgraded the JarBundler library to the newest version available; - other dings and dents fixed.
- Loading branch information
Jan Willem Janssen
committed
May 6, 2014
1 parent
ece4d47
commit 03f939b
Showing
12 changed files
with
211 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#!/bin/bash | ||
# | ||
# Script to create a disk image from an OSX App. Based on <http://stackoverflow.com/a/1513578/229140> | ||
|
||
# Include current version & name... | ||
. ./ols.version | ||
|
||
src_dir=generated/osx | ||
tmp_dmg=generated/ols-tmp.dmg | ||
out_dmg=generated/ols-${ols_version}-full.dmg | ||
mnt_pnt=/Volumes/${ols_shortName} | ||
|
||
# Clean up stuff from earlier runs... | ||
if [ -f ${tmp_dmg} ]; then | ||
rm -f ${tmp_dmg} | ||
fi | ||
if [ -f ${out_dmg} ]; then | ||
rm -f ${out_dmg} | ||
fi | ||
|
||
size=$((2 + $(du -mc "${src_dir}" | tail -1 | awk '{print $1}'))) | ||
|
||
echo "Creating temporary disk image of $size MB..." | ||
hdiutil create -srcfolder "${src_dir}" -volname "${ols_shortName}" -fs 'HFS+' -fsargs "-c c=64,a=16,e=16" -format UDRW -size "${size}M" ${tmp_dmg} -quiet | ||
|
||
echo "Mounting temporary disk image & arranging stuff..." | ||
device=$(hdiutil attach -readwrite -noverify -noautoopen "${tmp_dmg}" | egrep '^/dev/' | sed 1q | awk '{print $1}') | ||
|
||
osascript <<EOF | ||
tell application "Finder" | ||
repeat until exists disk "${ols_shortName}" | ||
delay 1 | ||
end repeat | ||
tell disk "${ols_shortName}" | ||
open | ||
set current view of container window to icon view | ||
set toolbar visible of container window to false | ||
set statusbar visible of container window to false | ||
set the bounds of container window to {400, 100, 885, 430} | ||
set theViewOptions to the icon view options of container window | ||
set arrangement of theViewOptions to not arranged | ||
set icon size of theViewOptions to 96 | ||
set background picture of theViewOptions to file ".background:background.png" | ||
-- make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"} | ||
do shell script "ln -s /Applications /Volumes/LogicSniffer/Applications" | ||
set position of item "${ols_shortName}" of container window to {90, 165} | ||
set position of item "Applications" of container window to {395, 165} | ||
close | ||
open | ||
update with necessity without registering applications | ||
update without registering applications | ||
delay 5 | ||
close | ||
end tell | ||
end tell | ||
EOF | ||
|
||
icon="resources/Package.icns" | ||
tmp_icon="generated/icon-resource.r" | ||
|
||
echo "read 'icns' (-16455) \"${icon}\";" > ${tmp_icon} | ||
ifile="`printf \"${mnt_pnt}/Icon\r\"`" | ||
Rez -o "${ifile}" ${tmp_icon} || exit $? | ||
#rm -f ${tmp_icon} | ||
SetFile -a C "${mnt_pnt}" | ||
SetFile -a V "${ifile}" | ||
|
||
sync && sync | ||
|
||
if [ -d ${mnt_pnt} ]; then | ||
echo "Unmounting disk..." | ||
hdiutil detach "${device}" -quiet || hdiutil detach -force "${device}" -quiet | ||
|
||
if [ -d ${mnt_pnt} ]; then | ||
echo "Forcing unmount of disk..." | ||
diskutil unmount force ${mnt_pnt} | ||
fi | ||
fi | ||
|
||
# echo "Resizing temporary disk image..." | ||
# hdiutil resize -shrinkonly -size min -nofinalgap "${tmp_dmg}" | ||
|
||
echo "Converting temporary disk image to final disk image..." | ||
hdiutil convert "${tmp_dmg}" -format UDZO -o "${out_dmg}" -quiet && rm -f "${tmp_dmg}" | ||
|
||
echo "Internet-enabling final disk image..." | ||
hdiutil internet-enable -yes ${out_dmg} -quiet | ||
|
||
###EOF### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
import org.apache.tools.ant.taskdefs.condition.Os | ||
import org.apache.tools.ant.filters.ReplaceTokens | ||
|
||
assert(project != rootProject) | ||
|
||
loadProperties "ols.version" | ||
|
||
def loadProperties(String sourceFileName) { | ||
def config = new Properties() | ||
def propFile = new File(sourceFileName) | ||
if (propFile.canRead()) { | ||
config.load(new FileInputStream(propFile)) | ||
for (Map.Entry property in config) { | ||
ext[property.key] = property.value; | ||
} | ||
} | ||
} | ||
|
||
def createDir(String name) { | ||
def dir = file(name) | ||
if ((!dir.exists() && !dir.mkdirs()) || !dir.isDirectory()) { | ||
throw new GradleException("Could not create directory $dir") | ||
} | ||
dir | ||
} | ||
|
||
// Preparation | ||
def releaseBase = createDir('generated/release') | ||
def releaseBin = createDir("$releaseBase/bin") | ||
def releasePlugins = createDir("$releaseBase/plugins") | ||
|
||
task packageRelease { | ||
description "Assembles release artifacts." | ||
group "Release" | ||
|
||
doLast { | ||
ant.taskdef(name: 'createDist', classname: 'aQute.bnd.ant.RunconfigToDistributionTask', classpath: "../cnf/gradle/dependencies/biz.aQute.bnd.jar") | ||
|
||
delete "$releasePlugins" | ||
|
||
ant.createDist(rootDir: '..', allowSnapshots: 'true', bndFile: 'local.bndrun', outputdir: "$releasePlugins") | ||
|
||
/* The actual runner + fw */ | ||
copy { | ||
into "$releaseBin" | ||
include '*.jar' | ||
from '../runner/generated' | ||
from 'resources/lib' | ||
} | ||
|
||
/* the run scripts */ | ||
copy { | ||
into "$releaseBase" | ||
filter(ReplaceTokens, tokens: ['ols_shortName': ols_shortName, 'ols_version': ols_version]) | ||
from('resources/run') { | ||
include '*.sh' | ||
fileMode 0755 | ||
} | ||
from('resources/run') { | ||
exclude '*.sh' | ||
fileMode 0644 | ||
} | ||
} | ||
} | ||
} | ||
|
||
task createZipball(type: Zip) { | ||
destinationDir = file('generated') | ||
archiveName = "ols-${ols_version}-full.zip" | ||
from "$releaseBase" | ||
} | ||
|
||
task createTarball(type: Tar) { | ||
destinationDir = file('generated') | ||
archiveName = "ols-${ols_version}-full.tar.gz" | ||
compression = "gzip" | ||
from "$releaseBase" | ||
} | ||
|
||
task createDiskImage { | ||
onlyIf { | ||
/* only run this task on OSX/Darwin */ | ||
Os.isFamily(Os.FAMILY_MAC) | ||
} | ||
doLast { | ||
ant.taskdef(name: 'jarBundler', classname: 'net.sourceforge.jarbundler.JarBundler', classpath: "../cnf/buildrepo/net.sourceforge.jarbundler/jarbundler-2.3.0.jar") | ||
|
||
def osxBase = createDir('generated/osx') | ||
def bgDir = createDir("$osxBase/.background") | ||
|
||
copy { | ||
from('resources') | ||
into "$bgDir" | ||
include 'background.png' | ||
} | ||
|
||
ant.jarBundler(dir: "$osxBase", bundleid: 'nl.lxtreme.ols', name: "$ols_shortName", shortname: "$ols_shortName", mainclass: 'nl.lxtreme.ols.runner.Runner', version: "$ols_version", build: '1', jvmversion: '1.6+', workingdirectory: '$APP_PACKAGE/Contents/Resources/Java', vmoptions: '-Xmx1024m', icon: 'resources/LogicSniffer.icns', arguments: '-logToFile') { | ||
/* put all bin/*.jar files on the class path */ | ||
jarfileset(dir: "$releaseBase", includes: "bin/*.jar", excludes: "bin/jgoodies*.jar") | ||
javafileset(dir: "$releaseBase", includes: "plugins/*.*", excludes: "plugins/*gogo*.jar") | ||
} | ||
} | ||
} | ||
|
||
createZipball.mustRunAfter packageRelease | ||
createTarball.mustRunAfter packageRelease | ||
createDiskImage.mustRunAfter packageRelease | ||
|
||
assemble.dependsOn packageRelease | ||
assemble.dependsOn createZipball | ||
assemble.dependsOn createTarball | ||
assemble.dependsOn createDiskImage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
ols.shortName=LogicSniffer | ||
ols.version=0.9.8.snapshot | ||
ols_shortName=LogicSniffer | ||
ols_version=0.9.8.snapshot |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
OpenBench LogicSniffer Client | ||
############################# | ||
OpenBench LogicSniffer Client - @ols_version@ | ||
###################################### | ||
J.W. Janssen, <[email protected]> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters