mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
move build files to src/main/config
This commit is contained in:
7
.gitattributes
vendored
7
.gitattributes
vendored
@@ -9380,7 +9380,14 @@ res/reprintSetInfo.py svneol=native#text/x-python
|
||||
res/sealed/juzamjedi.zsealed -text
|
||||
res/setInfoScript.py svneol=native#text/x-python
|
||||
res/sound/tap.mp3 -text svneol=unset#audio/mpeg
|
||||
src/main/config/Forge.icns -text
|
||||
src/main/config/backgroundImage.jpg -text svneol=unset#image/jpeg
|
||||
src/main/config/create-dmg -text
|
||||
src/main/config/forge.ico -text svneol=unset#image/ico
|
||||
src/main/config/forge.sh svneol=native#text/x-sh
|
||||
src/main/config/forge_checks.xml svneol=native#text/xml
|
||||
src/main/config/support/AdiumApplescriptRunner -text
|
||||
src/main/config/support/template.applescript -text
|
||||
src/main/java/arcane/ui/CardArea.java svneol=native#text/plain
|
||||
src/main/java/arcane/ui/CardPanel.java svneol=native#text/plain
|
||||
src/main/java/arcane/ui/CardPanelContainer.java svneol=native#text/plain
|
||||
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,4 +1,8 @@
|
||||
/*.idea
|
||||
/*.iml
|
||||
/*.tmp
|
||||
.settings/org.eclipse.core.resources.prefs
|
||||
/forge.log
|
||||
/forge.preferences
|
||||
/release.properties
|
||||
/target
|
||||
|
||||
12
pom.xml
12
pom.xml
@@ -139,6 +139,10 @@
|
||||
<archive>http://www.slightlymagic.net/forum/viewforum.php?f=52</archive>
|
||||
</mailingList>
|
||||
</mailingLists>
|
||||
|
||||
<properties>
|
||||
<configSourceDirectory>${basedir}/src/main/config</configSourceDirectory>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<extensions>
|
||||
@@ -180,7 +184,7 @@
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<file>build/forge.sh</file>
|
||||
<file>${configSourceDirectory}/forge.sh</file>
|
||||
<outputFile>
|
||||
${project.build.directory}/forge.sh
|
||||
</outputFile>
|
||||
@@ -644,7 +648,7 @@
|
||||
</jar>
|
||||
<dontWrapJar>true</dontWrapJar>
|
||||
<errTitle>forge</errTitle>
|
||||
<icon>${basedir}/build/forge.ico</icon>
|
||||
<icon>${configSourceDirectory}/forge.ico</icon>
|
||||
<classPath>
|
||||
<mainClass>forge.Gui_NewGame</mainClass>
|
||||
<addDependencies>false</addDependencies>
|
||||
@@ -827,8 +831,8 @@
|
||||
<symlink
|
||||
link="${project.build.directory}/${project.build.finalName}-osx/Applications"
|
||||
resource="/Applications"/>
|
||||
<exec executable="${basedir}/build/create-dmg" failonerror="false">
|
||||
<arg line="--volname ${project.name}-${project.version} --background ${basedir}/build/backgroundImage.jpg --window-size 700 419 --icon-size 64 --icon ${forge.file.name} 141 283 --icon ${applications.file.name} 452 283 --icon ${changes.file.name} 645 80 --icon ${license.file.name} 645 200 --icon ${readme.file.name} 645 320 ${project.build.directory}/${project.build.finalName}.dmg ${project.build.directory}/${project.build.finalName}-osx"/>
|
||||
<exec executable="${configSourceDirectory}/create-dmg" failonerror="false">
|
||||
<arg line="--volname ${project.name}-${project.version} --background ${configSourceDirectory}/backgroundImage.jpg --window-size 700 419 --icon-size 64 --icon ${forge.file.name} 141 283 --icon ${applications.file.name} 452 283 --icon ${changes.file.name} 645 80 --icon ${license.file.name} 645 200 --icon ${readme.file.name} 645 320 ${project.build.directory}/${project.build.finalName}.dmg ${project.build.directory}/${project.build.finalName}-osx"/>
|
||||
</exec>
|
||||
<tar basedir="${project.build.directory}"
|
||||
includes="${project.build.finalName}.dmg"
|
||||
|
||||
BIN
src/main/config/Forge.icns
Normal file
BIN
src/main/config/Forge.icns
Normal file
Binary file not shown.
BIN
src/main/config/backgroundImage.jpg
Normal file
BIN
src/main/config/backgroundImage.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 390 KiB |
168
src/main/config/create-dmg
Executable file
168
src/main/config/create-dmg
Executable file
@@ -0,0 +1,168 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Create a read-only disk image of the contents of a folder
|
||||
#
|
||||
# Usage: make-diskimage <image_file>
|
||||
# <src_folder>
|
||||
# <volume_name>
|
||||
# <applescript>
|
||||
# <artpath>
|
||||
# <eula_resource_file>
|
||||
|
||||
set -e;
|
||||
|
||||
function pure_version() {
|
||||
echo '1.0.0.2'
|
||||
}
|
||||
|
||||
function version() {
|
||||
echo "create-dmg $(pure_version)"
|
||||
}
|
||||
|
||||
function usage() {
|
||||
version
|
||||
echo "Creates a fancy DMG file."
|
||||
echo "Usage: $(basename $0) options... image.dmg source_folder"
|
||||
echo "All contents of source_folder will be copied into the disk image."
|
||||
echo "Options:"
|
||||
echo " --volname name"
|
||||
echo " set volume name (displayed in the Finder sidebar and window title)"
|
||||
echo " --background pic.png"
|
||||
echo " set folder background image (provide png, gif, jpg)"
|
||||
echo " --window-pos x y"
|
||||
echo " set position the folder window"
|
||||
echo " --window-size width height"
|
||||
echo " set size of the folder window"
|
||||
echo " --icon-size icon_size"
|
||||
echo " set window icons size (up to 128)"
|
||||
echo " --icon file_name x y"
|
||||
echo " set position of the file's icon"
|
||||
echo " --custom-icon file_name custom_icon_or_sample_file x y"
|
||||
echo " set position and custom icon"
|
||||
echo " --version show tool version number"
|
||||
echo " -h, --help display this help"
|
||||
exit 0
|
||||
}
|
||||
|
||||
WINX=10
|
||||
WINY=60
|
||||
WINW=600
|
||||
WINH=400
|
||||
ICON_SIZE=128
|
||||
|
||||
while test "${1:0:1}" = "-"; do
|
||||
case $1 in
|
||||
--volname)
|
||||
VOLUME_NAME="$2"
|
||||
shift; shift;;
|
||||
--background)
|
||||
BACKGROUND_FILE="$2"
|
||||
BACKGROUND_FILE_NAME="$(basename $BACKGROUND_FILE)"
|
||||
BACKGROUND_CLAUSE="set background picture of opts to file \".background:$BACKGROUND_FILE_NAME\""
|
||||
shift; shift;;
|
||||
--icon-size)
|
||||
ICON_SIZE="$2"
|
||||
shift; shift;;
|
||||
--window-pos)
|
||||
WINX=$2; WINY=$3
|
||||
shift; shift; shift;;
|
||||
--window-size)
|
||||
WINW=$2; WINH=$3
|
||||
shift; shift; shift;;
|
||||
--icon)
|
||||
POSITION_CLAUSE="${POSITION_CLAUSE}set position of item \"$2\" to {$3, $4}
|
||||
"
|
||||
shift; shift; shift; shift;;
|
||||
--custom-icon)
|
||||
shift; shift; shift; shift; shift;;
|
||||
-h | --help)
|
||||
usage;;
|
||||
--version)
|
||||
version; exit 0;;
|
||||
--pure-version)
|
||||
pure_version; exit 0;;
|
||||
-*)
|
||||
echo "Unknown option $1. Run with --help for help."
|
||||
exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$2" && {
|
||||
echo "Not enough arguments. Invoke with --help for help."
|
||||
exit 1
|
||||
}
|
||||
|
||||
DMG_PATH="$1"
|
||||
DMG_DIRNAME="$(dirname "$DMG_PATH")"
|
||||
DMG_DIR="$(cd $DMG_DIRNAME > /dev/null; pwd)"
|
||||
DMG_NAME="$(basename "$DMG_PATH")"
|
||||
DMG_TEMP_NAME="$DMG_DIR/rw.${DMG_NAME}"
|
||||
SRC_FOLDER="$(cd "$2" > /dev/null; pwd)"
|
||||
test -z "$VOLUME_NAME" && VOLUME_NAME="$(basename "$DMG_PATH" .dmg)"
|
||||
|
||||
AUX_PATH="$(cd "$(dirname $0)"; pwd)/support"
|
||||
|
||||
test -d "$AUX_PATH" || {
|
||||
echo "Cannot find support directory: $AUX_PATH"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Create the image
|
||||
echo "Creating disk image..."
|
||||
test -f "${DMG_TEMP_NAME}" && rm -f "${DMG_TEMP_NAME}"
|
||||
hdiutil create -srcfolder "$SRC_FOLDER" -volname "${VOLUME_NAME}" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW -size 300m "${DMG_TEMP_NAME}"
|
||||
|
||||
# mount it
|
||||
echo "Mounting disk image..."
|
||||
MOUNT_DIR="/Volumes/${VOLUME_NAME}"
|
||||
echo "Mount directory: $MOUNT_DIR"
|
||||
DEV_NAME=$(hdiutil attach -readwrite -noverify -noautoopen "${DMG_TEMP_NAME}" | egrep '^/dev/' | sed 1q | awk '{print $1}')
|
||||
echo "Device name: $DEV_NAME"
|
||||
|
||||
#cp RightDS_Store "/Volumes/${VOLUME_NAME}/.DS_Store"
|
||||
|
||||
if ! test -z "$BACKGROUND_FILE"; then
|
||||
echo "Copying background file..."
|
||||
test -d "$MOUNT_DIR/.background" || mkdir "$MOUNT_DIR/.background"
|
||||
cp "$BACKGROUND_FILE" "$MOUNT_DIR/.background/$BACKGROUND_FILE_NAME"
|
||||
fi
|
||||
|
||||
# run applescript
|
||||
APPLESCRIPT=$(mktemp -t createdmg)
|
||||
cat "$AUX_PATH/template.applescript" | sed -e "s/WINX/$WINX/g" -e "s/WINY/$WINY/g" -e "s/WINW/$WINW/g" -e "s/WINH/$WINH/g" -e "s/BACKGROUND_CLAUSE/$BACKGROUND_CLAUSE/g" -e "s/ICON_SIZE/$ICON_SIZE/g" | perl -pe "s/POSITION_CLAUSE/$POSITION_CLAUSE/g" >"$APPLESCRIPT"
|
||||
|
||||
echo "Running Applescript: ./AdiumApplescriptRunner \"${APPLESCRIPT}\" process_disk_image \"${VOLUME_NAME}\""
|
||||
"$AUX_PATH/AdiumApplescriptRunner" "${APPLESCRIPT}" process_disk_image "${VOLUME_NAME}" || true
|
||||
echo "Done running the applescript..."
|
||||
sleep 4
|
||||
|
||||
# make sure it's not world writeable
|
||||
echo "Fixing permissions..."
|
||||
chmod -Rf go-w "${MOUNT_DIR}" || true
|
||||
echo "Done fixing permissions."
|
||||
|
||||
# make the top window open itself on mount:
|
||||
if [ -x /usr/local/bin/openUp ]; then
|
||||
echo "Applying openUp..."
|
||||
/usr/local/bin/openUp "${MOUNT_DIR}"
|
||||
fi
|
||||
|
||||
# unmount
|
||||
echo "Unmounting disk image..."
|
||||
hdiutil detach "${DEV_NAME}"
|
||||
|
||||
# compress image
|
||||
echo "Compressing disk image..."
|
||||
hdiutil convert "${DMG_TEMP_NAME}" -format UDZO -imagekey zlib-level=9 -o "${DMG_DIR}/${DMG_NAME}"
|
||||
rm -f "${DMG_TEMP_NAME}"
|
||||
|
||||
# adding EULA resources
|
||||
if [ ! -z "${EULA_RSRC}" -a "${EULA_RSRC}" != "-null-" ]; then
|
||||
echo "adding EULA resources"
|
||||
hdiutil unflatten "${DMG_DIR}/${DMG_NAME}"
|
||||
/Developer/Tools/ResMerger -a "${EULA_RSRC}" -o "${DMG_DIR}/${DMG_NAME}"
|
||||
hdiutil flatten "${DMG_DIR}/${DMG_NAME}"
|
||||
fi
|
||||
|
||||
echo "Disk image done"
|
||||
exit 0
|
||||
BIN
src/main/config/forge.ico
Normal file
BIN
src/main/config/forge.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 141 KiB |
3
src/main/config/forge.sh
Executable file
3
src/main/config/forge.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
cd "`dirname \"$0\"`"
|
||||
java -Xmx1024m -jar $project.build.finalName$
|
||||
BIN
src/main/config/support/AdiumApplescriptRunner
Normal file
BIN
src/main/config/support/AdiumApplescriptRunner
Normal file
Binary file not shown.
105
src/main/config/support/template.applescript
Normal file
105
src/main/config/support/template.applescript
Normal file
@@ -0,0 +1,105 @@
|
||||
on run -- for testing in script editor
|
||||
process_disk_image("Adium X 1.0b20", "/Users/evands/adium-1.0/Release/Artwork")
|
||||
end run
|
||||
|
||||
on process_disk_image(volumeName)
|
||||
tell application "Finder"
|
||||
tell disk (volumeName as string)
|
||||
open
|
||||
|
||||
set theXOrigin to WINX
|
||||
set theYOrigin to WINY
|
||||
set theWidth to WINW
|
||||
set theHeight to WINH
|
||||
|
||||
set theBottomRightX to (theXOrigin + theWidth)
|
||||
set theBottomRightY to (theYOrigin + theHeight)
|
||||
set dsStore to "\"" & "/Volumes/" & volumeName & "/" & ".DS_STORE\""
|
||||
-- do shell script "rm " & dsStore
|
||||
|
||||
tell container window
|
||||
set current view to icon view
|
||||
set toolbar visible to false
|
||||
set statusbar visible to false
|
||||
set the bounds to {theXOrigin, theYOrigin, theBottomRightX, theBottomRightY}
|
||||
set statusbar visible to false
|
||||
end tell
|
||||
|
||||
set opts to the icon view options of container window
|
||||
tell opts
|
||||
set icon size to ICON_SIZE
|
||||
set arrangement to not arranged
|
||||
end tell
|
||||
-- set background picture of opts to file ".background:background.png"
|
||||
BACKGROUND_CLAUSE
|
||||
|
||||
-- Positioning
|
||||
POSITION_CLAUSE
|
||||
-- set position of item "Adium.app" to {196, 273}
|
||||
|
||||
-- Custom icons
|
||||
-- my copyIconOfTo(artPath & "/ApplicationsIcon", "/Volumes/" & volumeName & "/Applications")
|
||||
|
||||
-- Label colors
|
||||
-- set label index of item "Adium.app" to 6
|
||||
-- set label index of item "License.txt" to 7
|
||||
-- set label index of item "Changes.txt" to 7
|
||||
-- set label index of item "Applications" to 4
|
||||
|
||||
update without registering applications
|
||||
-- Force saving of the size
|
||||
delay 1
|
||||
|
||||
tell container window
|
||||
set statusbar visible to false
|
||||
set the bounds to {theXOrigin, theYOrigin, theBottomRightX - 10, theBottomRightY - 10}
|
||||
end tell
|
||||
|
||||
update without registering applications
|
||||
end tell
|
||||
|
||||
delay 1
|
||||
|
||||
tell disk (volumeName as string)
|
||||
tell container window
|
||||
set statusbar visible to false
|
||||
set the bounds to {theXOrigin, theYOrigin, theBottomRightX, theBottomRightY}
|
||||
end tell
|
||||
|
||||
update without registering applications
|
||||
end tell
|
||||
|
||||
--give the finder some time to write the .DS_Store file
|
||||
delay 3
|
||||
|
||||
set waitTime to 0
|
||||
set ejectMe to false
|
||||
repeat while ejectMe is false
|
||||
delay 1
|
||||
set waitTime to waitTime + 1
|
||||
|
||||
if (do shell script "[ -f " & dsStore & " ]; echo $?") = "0" then set ejectMe to true
|
||||
end repeat
|
||||
log "waited " & waitTime & " seconds for .DS_STORE to be created."
|
||||
end tell
|
||||
end process_disk_image
|
||||
|
||||
on copyIconOfTo(aFileOrFolderWithIcon, aFileOrFolder)
|
||||
tell application "Finder" to set f to POSIX file aFileOrFolderWithIcon as alias
|
||||
-- grab the file's icon
|
||||
my CopyOrPaste(f, "c")
|
||||
-- now the icon is in the clipboard
|
||||
tell application "Finder" to set c to POSIX file aFileOrFolder as alias
|
||||
my CopyOrPaste(result, "v")
|
||||
end copyIconOfTo
|
||||
|
||||
on CopyOrPaste(i, cv)
|
||||
tell application "Finder"
|
||||
activate
|
||||
open information window of i
|
||||
end tell
|
||||
tell application "System Events" to tell process "Finder" to tell window 1
|
||||
keystroke tab -- select icon button
|
||||
keystroke (cv & "w") using command down (* (copy or paste) + close window *)
|
||||
end tell -- window 1 then process Finder then System Events
|
||||
end CopyOrPaste
|
||||
Reference in New Issue
Block a user