Skip to content

Commit

Permalink
New updates to handle the Keychain better, fresh HTML and JavaScript …
Browse files Browse the repository at this point in the history
…in the UI
  • Loading branch information
joshbirk committed Nov 22, 2011
1 parent 757d87a commit 0343bb5
Show file tree
Hide file tree
Showing 146 changed files with 26,433 additions and 176 deletions.
42 changes: 30 additions & 12 deletions Commands/Build All.tmCommand
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,53 @@
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<string>saveModifiedFiles</string>
<key>command</key>
<string>echo "&lt;h1&gt;Building Project&lt;/h1&gt;"
<string>echo "&lt;style&gt;body { margin: 0px; padding: 0px; background-color:#efefef }&lt;/style&gt;"
echo "&lt;div style='width:100%;background-image: -webkit-linear-gradient(left , rgb(76,142,255) 12%, rgb(105,199,250) 56%, rgb(255,255,255) 78%);'&gt;&lt;h2&gt;Build All&lt;/h2&gt;&lt;/div&gt;"
cd "$TM_PROJECT_DIRECTORY"
echo "&lt;div style='background-color:#ccc'&gt;&lt;pre&gt;;"
. build.properties
if[ ! -f "new.properties"]
if [ ! -f "new.properties" ]
then
if[ ${usekeychainaccess} == 'enabled' ]
if [ ${usekeychainaccess} == 'enabled' ]
then
cp build.properties build.back
cp build.properties build.bak
shellpassword=$(~/Library/Application\ Support/TextMate/Bundles/ForceDotBundle.tmbundle/Tools/keychain.sh ${password})
sed "s/${password}/${shellpassword}/" build.properties &gt; new.properties
cp new.properties build.properties
fi
fi
echo "&lt;div style='background-color: white; border:1px solid #999; font-family: Tahoma MS, Lucida, Verdana; padding: 5px; color: #666; margin: 2px;'&gt;"
echo "&lt;pre id='output_pre'&gt;"
ant build-all
echo "&lt;/pre&gt;"
echo "&lt;div id='output' style='color:black'&gt;&lt;/div&gt;&lt;/div&gt;"
echo "&lt;script&gt;"
echo "output = document.getElementById('output');
output.innerHTML = document.getElementById('output_pre').innerHTML;
document.getElementById('output_pre').style.display='none';
output.innerHTML = output.innerHTML.replace(/\n/gi,'&lt;br /&gt;');
output.innerHTML = output.innerHTML.replace(/BUILD SUCCESSFUL/gi,'&lt;span style=font-weight:bold;color:#526F35&gt;BUILD SUCCESSFUL&lt;/span&gt;');
output.innerHTML = output.innerHTML.replace(/BUILD FAILED/gi,'&amp;nbsp;&lt;span style=font-weight:bold;color:#CD2626&gt;BUILD FAILED&lt;/span&gt;');
output.innerHTML = output.innerHTML.replace(/ERROR:/gi,'&lt;HR /&gt;ERROR:');
output.innerHTML = output.innerHTML.replace(/\(/gi,'&lt;BR /&gt;&lt;span style=background-color:black;color:white&gt;&amp;nbsp;(');
output.innerHTML = output.innerHTML.replace(/\)\:/gi,')&amp;nbsp;&lt;/span&gt; Error Message: &amp;nbsp;&lt;BR /&gt;');
&lt;/script&gt;"
echo "&lt;hr&gt;&lt;button onclick='self.close();' style='border: 1px solid black; background-color:#ccc'&gt;Done&lt;/button&gt;"
if [ ${usekeychainaccess} == 'enabled' ]
then
cp build.bak build.properties
if [ -f "new.properties" ]
then
cp build.properties build.back
sed "s/${shellpassword}/${password}/" build.properties &gt; new.properties
cp new.properties build.properties
rm new.properties
rm build.back
fi
echo "&lt;/pre&gt;&lt;/div&gt;"
echo "&lt;hr&gt;Done"</string>
fi
</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
Expand Down
47 changes: 30 additions & 17 deletions Commands/Build File.tmCommand
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<key>beforeRunningCommand</key>
<string>saveActiveFile</string>
<key>command</key>
<string>echo "&lt;h1&gt;Building ${TM_FILENAME%.*}&lt;/h1&gt;"
<string>echo "&lt;style&gt;body { margin: 0px; padding: 0px; background-color:#efefef }&lt;/style&gt;"
echo "&lt;div style='width:100%;background-image: -webkit-linear-gradient(left , rgb(76,142,255) 12%, rgb(105,199,250) 56%, rgb(255,255,255) 78%);'&gt;&lt;h2&gt;Build File: ${TM_FILENAME%.*}&lt;/h2&gt;&lt;/div&gt;"
if [ ${TM_FILENAME##*.} == 'xml' ]
then
Expand Down Expand Up @@ -47,13 +48,13 @@ fi
fi
cd "$TM_PROJECT_DIRECTORY"
. build.properties
if [ ! -f "new.properties" ]
then
if [ ${usekeychainaccess} == 'enabled' ]
then
cp build.properties build.back
cp build.properties build.bak
shellpassword=$(~/Library/Application\ Support/TextMate/Bundles/ForceDotBundle.tmbundle/Tools/keychain.sh ${password})
sed "s/${password}/${shellpassword}/" build.properties &gt; new.properties
cp new.properties build.properties
Expand All @@ -62,7 +63,6 @@ fi
#echo ${TM_FILENAME%.*}
echo "&lt;hr&gt;&lt;h4&gt;Cleanup&lt;/h4&gt;"
rm -R tmp
mkdir tmp
cd tmp
Expand Down Expand Up @@ -99,24 +99,37 @@ cp triggers/${TM_FILENAME%.*}.trigger-meta.xml tmp/triggers/
fi
cp package.xml tmp/
echo "&lt;h1&gt;Building&lt;/h1&gt;"
echo "&lt;div style='background-color:#ccc'&gt;"
echo "&lt;pre&gt;"
echo "&lt;div style='background-color: white; border:1px solid #999; font-family: Tahoma MS, Lucida, Verdana; padding: 5px; color: #666; margin: 2px;'&gt;"
echo "&lt;pre id='output_pre'&gt;"
ant build
echo "&lt;/pre&gt;&lt;/div&gt;"
echo "&lt;hr&gt;Done"
echo "&lt;/pre&gt;"
echo "&lt;div id='output' style='color:black'&gt;&lt;/div&gt;&lt;/div&gt;"
echo "&lt;script&gt;"
echo "output = document.getElementById('output');
output.innerHTML = document.getElementById('output_pre').innerHTML;
document.getElementById('output_pre').style.display='none';
output.innerHTML = output.innerHTML.replace(/\n/gi,'&lt;br /&gt;');
output.innerHTML = output.innerHTML.replace(/BUILD SUCCESSFUL/gi,'&lt;span style=font-weight:bold;color:#526F35&gt;BUILD SUCCESSFUL&lt;/span&gt;');
output.innerHTML = output.innerHTML.replace(/BUILD FAILED/gi,'&amp;nbsp;&lt;span style=font-weight:bold;color:#CD2626&gt;BUILD FAILED&lt;/span&gt;');
output.innerHTML = output.innerHTML.replace(/ERROR:/gi,'&lt;HR /&gt;ERROR:');
output.innerHTML = output.innerHTML.replace(/\(/gi,'&lt;BR /&gt;&lt;span style=background-color:black;color:white&gt;&amp;nbsp;(');
output.innerHTML = output.innerHTML.replace(/\)\:/gi,')&amp;nbsp;&lt;/span&gt; Error Message: &amp;nbsp;&lt;BR /&gt;');
&lt;/script&gt;"
echo "&lt;hr&gt;&lt;button onclick='self.close();' style='border: 1px solid black; background-color:#ccc'&gt;Done&lt;/button&gt;"
date '+%m-%d-%y %H:%M:%S' &gt; .lastbuild
#cleanup
if [ ${usekeychainaccess} == 'enabled' ]
then
cp build.properties build.back
sed "s/${shellpassword}/${password}/" build.properties &gt; new.properties
cp new.properties build.properties
rm new.properties
rm build.back
then
cp build.bak build.properties
if [ -f "new.properties" ]
then
rm new.properties
fi
fi</string>
<key>input</key>
<string>none</string>
Expand Down
54 changes: 37 additions & 17 deletions Commands/Build Latest.tmCommand
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<string>saveModifiedFiles</string>
<key>command</key>
<string>cd "$TM_PROJECT_DIRECTORY"
. build.properties
echo "&lt;style&gt;body { margin: 0px; padding: 0px; background-color:#efefef }&lt;/style&gt;"
echo "&lt;div style='width:100%;background-image: -webkit-linear-gradient(left , rgb(76,142,255) 12%, rgb(105,199,250) 56%, rgb(255,255,255) 78%);'&gt;&lt;h2&gt;Building Latest&lt;/h2&gt;&lt;/div&gt;"
if [ ! -f "new.properties" ]
then
if [ ${usekeychainaccess} == 'enabled' ]
then
cp build.properties build.back
cp build.properties build.bak
shellpassword=$(~/Library/Application\ Support/TextMate/Bundles/ForceDotBundle.tmbundle/Tools/keychain.sh ${password})
sed "s/${password}/${shellpassword}/" build.properties &gt; new.properties
cp new.properties build.properties
Expand All @@ -27,16 +30,16 @@ mkdir pages
mkdir triggers
cd ..
echo "&lt;h1&gt;Building Latest&lt;/h1&gt;"
echo "&lt;pre&gt;"
echo "&lt;div style='margin: 2px; border: 1px solid #999; padding: 2px; background-color: white'&gt;Found:&amp;nbsp;"
cd "${TM_PROJECT_DIRECTORY}"
cd classes
for file in $(find . -name "*.cls" -mtime -1)
do
filename=${file%.*}
i=${filename:2}
echo $i
echo "${i}&amp;nbsp"
if [ ! -f "${i}.cls-meta.xml" ]
then
echo '&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"&gt;&lt;apiVersion&gt;22.0&lt;/apiVersion&gt;&lt;status&gt;Active&lt;/status&gt;&lt;/ApexClass&gt;' &gt; "classes/${i}.cls-meta.xml"
Expand All @@ -49,7 +52,7 @@ for file in $(find . -name "*.page" -mtime -1)
do
filename=${file%.*}
i=${filename:2}
echo $i
echo "${i}&amp;nbsp"
if [ ! -f "${i}.page-meta.xml" ]
then
echo "&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;&lt;ApexPage xmlns=\"http://soap.sforce.com/2006/04/metadata\"&gt;&lt;apiVersion&gt;22.0&lt;/apiVersion&gt;&lt;label&gt;${i}&lt;/label&gt;&lt;/ApexPage&gt;" &gt; "pages/${i}.page-meta.xml"
Expand All @@ -62,7 +65,7 @@ for file in $(find . -name "*.component" -mtime -1)
do
filename=${file%.*}
i=${filename:2}
echo $i
echo "${i}&amp;nbsp"
if [ ! -f "${i}.component-meta.xml" ]
then
echo "&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;&lt;ApexComponent xmlns=\"http://soap.sforce.com/2006/04/metadata\"&gt;&lt;apiVersion&gt;22.0&lt;/apiVersion&gt;&lt;label&gt;${i}&lt;/label&gt;&lt;/ApexComponent&gt;" &gt; "components/${i}.component-meta.xml"
Expand All @@ -75,29 +78,46 @@ for file in $(find . -name "*.trigger" -mtime -1)
do
filename=${file%.*}
i=${filename:2}
echo $i
echo "${i}&amp;nbsp"
if [ ! -f "${i}.cls-meta.xml" ]
then
echo '&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;ApexTrigger xmlns="http://soap.sforce.com/2006/04/metadata"&gt;&lt;apiVersion&gt;22.0&lt;/apiVersion&gt;&lt;status&gt;Active&lt;/status&gt;&lt;/ApexTrigger&gt;' &gt; "triggers/${i}.triggers-meta.xml"
fi
cp ${i}* ../tmp/triggers
done
echo "&lt;/pre&gt;&lt;div style='background-color:#ccc'&gt;"
echo "&lt;pre&gt;"
echo "&lt;/div&gt;"
echo "&lt;div style='background-color: white; border:1px solid #999; font-family: Tahoma MS, Lucida, Verdana; padding: 5px; color: #666; margin: 2px;'&gt;"
echo "&lt;pre id='output_pre'&gt;"
cd ..
cp package.xml tmp/
ant build
echo "&lt;/pre&gt;"
echo "&lt;/div&gt;"
echo "&lt;div id='output' style='color:black'&gt;&lt;/div&gt;&lt;/div&gt;"
echo "&lt;script&gt;"
echo "output = document.getElementById('output');
output.innerHTML = document.getElementById('output_pre').innerHTML;
document.getElementById('output_pre').style.display='none';
output.innerHTML = output.innerHTML.replace(/\n/gi,'&lt;br /&gt;');
output.innerHTML = output.innerHTML.replace(/BUILD SUCCESSFUL/gi,'&lt;span style=font-weight:bold;color:#526F35&gt;BUILD SUCCESSFUL&lt;/span&gt;');
output.innerHTML = output.innerHTML.replace(/BUILD FAILED/gi,'&amp;nbsp;&lt;span style=font-weight:bold;color:#CD2626&gt;BUILD FAILED&lt;/span&gt;');
output.innerHTML = output.innerHTML.replace(/ERROR:/gi,'&lt;HR /&gt;ERROR:');
output.innerHTML = output.innerHTML.replace(/\(/gi,'&lt;BR /&gt;&lt;span style=background-color:black;color:white&gt;&amp;nbsp;(');
output.innerHTML = output.innerHTML.replace(/\)\:/gi,')&amp;nbsp;&lt;/span&gt; Error Message: &amp;nbsp;&lt;BR /&gt;');
&lt;/script&gt;"
echo "&lt;hr&gt;&lt;button onclick='self.close();' style='border: 1px solid black; background-color:#ccc'&gt;Done&lt;/button&gt;"
if [ ${usekeychainaccess} == 'enabled' ]
then
cp build.properties build.back
sed "s/${shellpassword}/${password}/" build.properties &gt; new.properties
cp new.properties build.properties
rm new.properties
rm build.back
then
cp build.bak build.properties
if [ -f "new.properties" ]
then
rm new.properties
fi
fi
Expand Down
41 changes: 28 additions & 13 deletions Commands/Build Sequential.tmCommand
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<string>saveModifiedFiles</string>
<key>command</key>
<string>cd "$TM_PROJECT_DIRECTORY"
. build.properties
if [ ! -f "new.properties" ]
then
if [ ${usekeychainaccess} == 'enabled' ]
then
cp build.properties build.back
cp build.properties build.bak
shellpassword=$(~/Library/Application\ Support/TextMate/Bundles/ForceDotBundle.tmbundle/Tools/keychain.sh ${password})
sed "s/${password}/${shellpassword}/" build.properties &gt; new.properties
cp new.properties build.properties
fi
fi
echo "&lt;h1&gt;Building Sequential&lt;/h1&gt;"
echo "&lt;style&gt;body { margin: 0px; padding: 0px; background-color:#efefef }&lt;/style&gt;"
echo "&lt;div style='width:100%;background-image: -webkit-linear-gradient(left , rgb(76,142,255) 12%, rgb(105,199,250) 56%, rgb(255,255,255) 78%);'&gt;&lt;h2&gt;Building Sequential&lt;/h2&gt;&lt;/div&gt;"
echo "&lt;div style='background-color: white; border:1px solid #999; font-family: Tahoma MS, Lucida, Verdana; padding: 5px; color: #666; margin: 2px;'&gt;"
echo "&lt;pre id='output_pre'&gt;"
echo "&lt;div style='background-color:#ccc'&gt;"
echo "&lt;pre&gt;"
FILES=*.manifest
for f in $FILES
do
Expand Down Expand Up @@ -87,16 +87,31 @@ ant build
done
if [ ${usekeychainaccess} == 'enabled' ]
then
cp build.properties build.back
sed "s/${shellpassword}/${password}/" build.properties &gt; new.properties
cp new.properties build.properties
rm new.properties
rm build.back
then
cp build.bak build.properties
if [ -f "new.properties" ]
then
rm new.properties
fi
fi
echo "&lt;/pre&gt;"
echo "&lt;/div&gt;"
echo "&lt;div id='output' style='color:black'&gt;&lt;/div&gt;&lt;/div&gt;"
echo "&lt;script&gt;"
echo "output = document.getElementById('output');
output.innerHTML = document.getElementById('output_pre').innerHTML;
document.getElementById('output_pre').style.display='none';
output.innerHTML = output.innerHTML.replace(/\n/gi,'&lt;br /&gt;');
output.innerHTML = output.innerHTML.replace(/BUILD SUCCESSFUL/gi,'&lt;span style=font-weight:bold;color:#526F35&gt;BUILD SUCCESSFUL&lt;/span&gt;');
output.innerHTML = output.innerHTML.replace(/BUILD FAILED/gi,'&amp;nbsp;&lt;span style=font-weight:bold;color:#CD2626&gt;BUILD FAILED&lt;/span&gt;');
output.innerHTML = output.innerHTML.replace(/ERROR:/gi,'&lt;HR /&gt;ERROR:');
output.innerHTML = output.innerHTML.replace(/\(/gi,'&lt;BR /&gt;&lt;span style=background-color:black;color:white&gt;&amp;nbsp;(');
output.innerHTML = output.innerHTML.replace(/\)\:/gi,')&amp;nbsp;&lt;/span&gt; Error Message: &amp;nbsp;&lt;BR /&gt;');
&lt;/script&gt;"
echo "&lt;hr&gt;&lt;button onclick='self.close();' style='border: 1px solid black; background-color:#ccc'&gt;Done&lt;/button&gt;"
</string>
Expand Down
Loading

0 comments on commit 0343bb5

Please sign in to comment.