Skip to content

Commit

Permalink
10/20/14 (v1.2)
Browse files Browse the repository at this point in the history
* ExtensionGenerator now uses exists() rather than relying on mkdirs'
return value. This should make it less sensitive to failure especially
when recreating directories that already exist.
* Changed the text of the build platform radio buttons to coincide with
recent ARC developments
  • Loading branch information
gummywormz committed Oct 21, 2014
1 parent cd158a7 commit ca664d1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
15 changes: 8 additions & 7 deletions src/jarc/apk/ExtensionGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ public void generate(File path){
try{
//write directories needed
File baseDir = new File(absPath + sep + pkg);
boolean worked = baseDir.mkdirs();
if(!worked){throw new java.io.IOException();}
baseDir.mkdirs();
if(!baseDir.exists()){throw new java.io.IOException();}
File loc = new File(baseDir.getAbsolutePath() + sep + "_locales" + sep + "en");
worked = loc.mkdirs();
if(!worked){throw new java.io.IOException();}
loc.mkdirs();
if(!loc.exists()){throw new java.io.IOException();}
File vend = new File(baseDir.getAbsolutePath() + sep + "vendor" + sep + "chromium" + sep + "crx");
worked = vend.mkdirs();
if(!worked){throw new java.io.IOException();}
vend.mkdirs();
if(!vend.exists()){throw new java.io.IOException();}
//begin writing the internal resources
OutputStream out = new FileOutputStream(loc.getAbsolutePath() + sep + "messages.json");
byte[] buf = new byte[1024];
Expand Down Expand Up @@ -180,7 +180,8 @@ public void generate(File path){

JARCUI.throwError("Operation Complete!");
}catch(java.io.IOException e){
JARCUI.throwError("Could not write some files. Make sure you have proper permissions! (If you are rebuilding a package, please delete the previous folder or save to a new one)");
e.printStackTrace();
JARCUI.throwError("Could not write some files. Make sure you have proper permissions!");
}
}
}
10 changes: 5 additions & 5 deletions src/jarc/apk/JARCUI.form
Original file line number Diff line number Diff line change
Expand Up @@ -243,18 +243,18 @@
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buildTarget"/>
</Property>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Chrome OS"/>
<Property name="toolTipText" type="java.lang.String" value="Builds the application for use on a ChromeBook or on Chrome OS."/>
<Property name="text" type="java.lang.String" value="Chrome OS (Version 37 or earlier)"/>
<Property name="toolTipText" type="java.lang.String" value="Builds the application for use on a ChromeBook or on Chrome OS older than version 38."/>
</Properties>
</Component>
<Component class="javax.swing.JRadioButton" name="archonBuild">
<Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="buildTarget"/>
</Property>
<Property name="text" type="java.lang.String" value="Chrome / ARChon"/>
<Property name="toolTipText" type="java.lang.String" value="Builds the application for Chrome running ARChon."/>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Chrome / ARChon / Chrome OS"/>
<Property name="toolTipText" type="java.lang.String" value="Builds the application for Chrome running ARChon or Chrome OS running later than version 37."/>
</Properties>
</Component>
</SubComponents>
Expand Down
10 changes: 5 additions & 5 deletions src/jarc/apk/JARCUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

buildTarget.add(chromeOSBuild);
chromeOSBuild.setSelected(true);
chromeOSBuild.setText("Chrome OS");
chromeOSBuild.setToolTipText("Builds the application for use on a ChromeBook or on Chrome OS.");
chromeOSBuild.setText("Chrome OS (Version 37 or earlier)");
chromeOSBuild.setToolTipText("Builds the application for use on a ChromeBook or on Chrome OS older than version 38.");

buildTarget.add(archonBuild);
archonBuild.setText("Chrome / ARChon");
archonBuild.setToolTipText("Builds the application for Chrome running ARChon.");
archonBuild.setSelected(true);
archonBuild.setText("Chrome / ARChon / Chrome OS");
archonBuild.setToolTipText("Builds the application for Chrome running ARChon or Chrome OS running later than version 37.");

javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
Expand Down

0 comments on commit ca664d1

Please sign in to comment.