Commit 6f376970 authored by Philippe Merle's avatar Philippe Merle
Browse files

* Fixed the issue of "no left space" on the Hudson server.

  When FraSCAti is run with Maven then use the 'target' directory as Juliac output directory.
  Else create a new temp directory deleted when the JVM will exit.
* Added the 'MAVEN-TARGET-DIRECTORY' SCA property to the Juliac component.
* Removed '/target' from the value of both GEN-DIRECTORY and CLASS-DIRECTORY properties.
* Removed static for the field GEN_DIRECTORY.
parent 4e70adcb
......@@ -75,16 +75,22 @@ public class JuliacComponent
@Property(name = "FRASCATI-GENERATED")
protected String FRASCATI_GENERATED = "FRASCATI_GENERATED";
/**
* Maven target directory.
*/
@Property(name = "MAVEN-TARGET-DIRECTORY")
protected String MAVEN_TARGET_DIRECTORY = "target";
/**
* Output directory for generated sources.
*/
@Property(name = "GEN-DIRECTORY")
protected static String GEN_DIRECTORY = "/target/generated-frascati-sources/";
protected String GEN_DIRECTORY = "/generated-frascati-sources";
// Output directory for compiled classes
// Must not be loaded by a ClassLoader which is not managed by the Assembly Factory
@Property(name = "CLASS-DIRECTORY")
protected String CLASS_DIRECTORY = "/target/generated-frascati-classes/";
protected String CLASS_DIRECTORY = "/generated-frascati-classes";
/**
* Reference to Juliac generator plugins.
......@@ -160,19 +166,27 @@ public class JuliacComponent
// File f = (defaultOutputDir == null) ? new File(".").getAbsoluteFile() : new File(defaultOutputDir);
File f;
try {
// The Juliac output directory is equals to:
// - the value of the FRASCATI_GENERATED system variable if set, or
// - the Maven target directory if exist, or
// - a new temp directory.
if(defaultOutputDir != null) {
f = new File(defaultOutputDir);
} else {
f = File.createTempFile("frascati",".tmp");
f.delete(); // delete the file
f.mkdir(); // recreate it as a directory
f = new File(MAVEN_TARGET_DIRECTORY).getAbsoluteFile();
if(!f.exists()) {
f = File.createTempFile("frascati",".tmp");
f.delete(); // delete the file
f.mkdir(); // recreate it as a directory
f.deleteOnExit(); // delete it when the JVM will exit.
}
}
} catch(IOException ioe) {
severe(new FrascatiException("Problem when creating a FraSCAti temp directory", ioe));
return;
}
log.info("Default target directory: " + f.toString());
log.info("Default Juliac target directory: " + f.toString());
// Set default output dir.
setOutputDir(f);
......
......@@ -32,8 +32,9 @@
<component name="juliac">
<implementation.java class="org.ow2.frascati.juliac.impl.JuliacComponent"/>
<property name="FRASCATI-GENERATED">FRASCATI_GENERATED</property>
<property name="GEN-DIRECTORY">/target/generated-frascati-sources/</property>
<property name="CLASS-DIRECTORY">/target/generated-frascati-classes/</property>
<property name="MAVEN-TARGET-DIRECTORY">target</property>
<property name="GEN-DIRECTORY">/generated-frascati-sources</property>
<property name="CLASS-DIRECTORY">/generated-frascati-classes</property>
<service name="tinfi-generation">
<interface.java interface="org.ow2.frascati.tinfi.api.TinfiGeneration"/>
</service>
......
......@@ -119,7 +119,7 @@
</children>
<styles xmi:type="notation:ShapeStyle" xmi:id="_3UN2YSX3Ed-Q3chPRhOcAg" fontName="Lucida Grande"/>
<element xmi:type="sca:Component" href="Juliac.composite#//@composite/@component.0"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_3UN2YiX3Ed-Q3chPRhOcAg" x="74" y="1" height="157"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_3UN2YiX3Ed-Q3chPRhOcAg" x="74" y="1" width="273" height="157"/>
</children>
<children xmi:type="notation:Shape" xmi:id="_AV1A0CX4Ed-Q3chPRhOcAg" type="Note" fontName="Lucida Grande" description="Generator plugins" fillColor="13369343" transparency="0" lineColor="6737151" lineWidth="1">
<children xmi:type="notation:BasicDecorationNode" xmi:id="_AV1n4CX4Ed-Q3chPRhOcAg" type="DiagramName">
......@@ -131,7 +131,7 @@
<styles xmi:type="notation:TextStyle" xmi:id="_AV1A0SX4Ed-Q3chPRhOcAg"/>
<styles xmi:type="notation:LineTypeStyle" xmi:id="_AV1A0iX4Ed-Q3chPRhOcAg"/>
<element xsi:nil="true"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_AV1A0yX4Ed-Q3chPRhOcAg" x="286" y="21" height="28"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_AV1A0yX4Ed-Q3chPRhOcAg" x="398" y="21" height="28"/>
</children>
<children xmi:type="notation:Shape" xmi:id="_J-yfICX4Ed-Q3chPRhOcAg" type="Note" fontName="Lucida Grande" description="Java compiler" fillColor="13369343" transparency="0" lineColor="6737151" lineWidth="1">
<children xmi:type="notation:BasicDecorationNode" xmi:id="_J-zGMCX4Ed-Q3chPRhOcAg" type="DiagramName">
......@@ -143,14 +143,14 @@
<styles xmi:type="notation:TextStyle" xmi:id="_J-yfISX4Ed-Q3chPRhOcAg"/>
<styles xmi:type="notation:LineTypeStyle" xmi:id="_J-yfIiX4Ed-Q3chPRhOcAg"/>
<element xsi:nil="true"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_J-yfIyX4Ed-Q3chPRhOcAg" x="282" y="97" width="89" height="29"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_J-yfIyX4Ed-Q3chPRhOcAg" x="402" y="93" width="89" height="29"/>
</children>
<styles xmi:type="notation:SortingStyle" xmi:id="_3UFThCX3Ed-Q3chPRhOcAg"/>
<styles xmi:type="notation:FilteringStyle" xmi:id="_3UFThSX3Ed-Q3chPRhOcAg"/>
</children>
<styles xmi:type="notation:ShapeStyle" xmi:id="_3UDeUSX3Ed-Q3chPRhOcAg" fontName="Lucida Grande"/>
<element xmi:type="sca:Composite" href="Juliac.composite#//@composite"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_3UDeUiX3Ed-Q3chPRhOcAg" width="461" height="213"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_3UDeUiX3Ed-Q3chPRhOcAg" width="577" height="213"/>
</children>
<styles xmi:type="notation:DiagramStyle" xmi:id="_3SXcQSX3Ed-Q3chPRhOcAg"/>
<element xmi:type="sca:DocumentRoot" href="Juliac.composite#/"/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment