Skip to content
Snippets Groups Projects
Commit f8d84d08 authored by Manlio Bacco's avatar Manlio Bacco
Browse files

No commit message

No commit message
parent cf5b3fba
No related branches found
No related tags found
No related merge requests found
Showing with 43 additions and 53 deletions
......@@ -2,7 +2,7 @@
<feature
id="org.universaal.tools.packaging.tool.feature"
label="AAL Studio Application Packager"
version="0.8.0"
version="0.8.2"
provider-name="universAAL"
plugin="org.universaal.tools.aalstudio.core">
......
......@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: AAL Studio Application Packager
Bundle-SymbolicName: org.universaal.tools.packaging.tool; singleton:=true
Bundle-Version: 0.8.0
Bundle-Version: 0.8.2
Bundle-Activator: org.universaal.tools.packaging.tool.Activator
Require-Bundle: org.eclipse.core.runtime,
javax.xml,
......
......@@ -500,7 +500,6 @@ public class Page4 extends PageImpl {
if(current.getKey().equals(r)){
current.setValue(REQ_STATE.ALREADY_IN);
//System.out.println("ALREADY_IN");
return true;
}
}
......@@ -509,7 +508,7 @@ public class Page4 extends PageImpl {
}
}
this.thisReqsPage.put(r, REQ_STATE.NEW); //System.out.println("NEW");
this.thisReqsPage.put(r, REQ_STATE.NEW);
return false;
}
......@@ -519,7 +518,7 @@ public class Page4 extends PageImpl {
Iterator<Entry<Requirement, REQ_STATE>> it = entryset.iterator();
while(it.hasNext()){
Entry<Requirement, REQ_STATE> current = it.next();
current.setValue(REQ_STATE.PREVIOUS); //System.out.println("PREVIOUS");
current.setValue(REQ_STATE.PREVIOUS);
}
}
......@@ -530,7 +529,7 @@ public class Page4 extends PageImpl {
while(it.hasNext()){
Entry<Requirement, REQ_STATE> current = it.next();
if(current.getValue() == REQ_STATE.PREVIOUS){
current.setValue(REQ_STATE.TO_BE_DELETED); //System.out.println("TO_BE_DELETED");
current.setValue(REQ_STATE.TO_BE_DELETED);
}
}
}
......@@ -545,17 +544,12 @@ public class Page4 extends PageImpl {
if(current.getValue() == REQ_STATE.TO_BE_DELETED){
for(int i = 0; i < this.app.getAppRequirements().getRequirementsList().size(); i++){
if(//this.app.getRequirements().getRequirementsList().get(i) != null &&
this.app.getAppRequirements().getRequirementsList().get(i).equals(current.getKey())){
//System.out.println("\n**removing: "+this.app.getRequirements().getRequirementsList().get(i).getXML());
if(this.app.getAppRequirements().getRequirementsList().get(i).equals(current.getKey())){
this.app.getAppRequirements().getRequirementsList().set(i, null);
}
}
}
}
//System.out.println(this.toString()+" thisReqsPage: "+this.thisReqsPage.size());
//System.out.println(this.toString()+" getRequirementsList: "+this.app.getRequirements().getRequirementsList().size());
}
private void updateMap(){
......@@ -574,19 +568,6 @@ public class Page4 extends PageImpl {
this.thisReqsPage.remove(removeMe.get(i));
}
// private void debugPrint(String s){
//
// System.out.println("\ndebugPrint "+s);
//
// Set<Entry<Requirement, REQ_STATE>> entryset = this.thisReqsPage.entrySet();
// Iterator<Entry<Requirement, REQ_STATE>> it = entryset.iterator();
// while(it.hasNext()){
// Entry<Requirement, REQ_STATE> current = it.next();
//
// System.out.println(""+current.getKey().getXML()+" "+current.getValue());
// }
// }
private enum REQ_STATE{
NEW, PREVIOUS, ALREADY_IN, TO_BE_DELETED
}
......
......@@ -306,7 +306,7 @@ public class PagePartDU extends PageImpl {
if(cu1.getText().equals(Container.KARAF.toString())){
KarafFeaturesGenerator krf = new KarafFeaturesGenerator();
String karaf = krf.generate(this.part, /*ckbKar.getSelection()*/true, partNumber);
String karaf = krf.generate(this.part, true, partNumber);
if(karaf != null && !karaf.isEmpty())
cu = new ContainerUnit(Embedding.valueOf(emb1.getText()), karaf);
else
......
......@@ -578,19 +578,6 @@ public class PagePartPR extends PageImpl {
this.thisReqsPage.remove(removeMe.get(i));
}
/*private void debugPrint(String s){
System.out.println("\ndebugPrint "+s);
Set<Entry<Requirement, REQ_STATE>> entryset = this.thisReqsPage.entrySet();
Iterator<Entry<Requirement, REQ_STATE>> it = entryset.iterator();
while(it.hasNext()){
Entry<Requirement, REQ_STATE> current = it.next();
System.out.println(""+current.getKey().getXML()+" "+current.getValue());
}
}*/
private enum REQ_STATE{
NEW, PREVIOUS, ALREADY_IN, TO_BE_DELETED
}
......
......@@ -81,7 +81,7 @@ public class KarafFeaturesGenerator {
if(execution_result != null && execution_result.getExceptions() != null)
for(int i = 0; i < execution_result.getExceptions().size(); i++)
ret = ret.concat(execution_result.getExceptions().get(i).getMessage()+"\n");
System.out.println("[ERROR] The generation of Karaf features is failed: "+ret);
System.out.println("[Application Packager] - ERROR! The generation of Karaf features is failed: "+ret);
return "";
}
......@@ -183,17 +183,32 @@ public class KarafFeaturesGenerator {
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceDescription description = workspace.getDescription();
if (!description.isAutoBuilding())
System.out.println("[Application Packager] - Preparing for Karaf features file generation...");
if (!description.isAutoBuilding()){
System.out.println("[Application Packager] - "+projectName+" will be compiled now because autobuilding is off.");
goals.add("compiler:compile"); // compile it if autobuilding is off
request.setGoals(goals);
request.setUserProperties(props);
execution_result = maven.execute(request, null);
System.out.println("[Application Packager] - Compiling operation ended.");
}
System.out.println("[Application Packager] - Generating Karaf features file...");
goals.clear();
props = new Properties();
goals.add("features:generate-features-xml");
request.setGoals(goals);
request.setUserProperties(props);
execution_result = maven.execute(request, null);
if(execution_result.getExceptions() == null || execution_result.getExceptions().isEmpty())
if(execution_result.getExceptions() == null || execution_result.getExceptions().isEmpty()){
System.out.println("[Application Packager] - Karaf features file generated successfully.");
return true;
}
else{
System.out.println("[Application Packager] - Karaf features file not generated because of errors:");
for(int i = 0; i < execution_result.getExceptions().size(); i++)
System.out.println("[Application Packager] - "+execution_result.getExceptions().get(i).getMessage());
}
}
}
catch(Exception ex){
......
......@@ -49,16 +49,23 @@ public class CreateJar {
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceDescription description = workspace.getDescription();
if (!description.isAutoBuilding())
System.out.println("[Application Packager] - Preparing for packaging "+part.getName()+" project...");
if (!description.isAutoBuilding()){
goals.add("compiler:compile"); // compile it if autobuilding is off
}
System.out.println("[Application Packager] - Packaging "+part.getName()+" project...");
goals.add("package");
request.setGoals(goals);
request.setUserProperties(props);
MavenExecutionResult execution_result = maven.execute(request, null);
if(execution_result.getExceptions() != null && !execution_result.getExceptions().isEmpty())
for(int i = 0; i < execution_result.getExceptions().size(); i++)
System.out.println("\nERROR: "+execution_result.getExceptions().get(i).getMessage());
for(int i = 0; i < execution_result.getExceptions().size(); i++){
System.out.println("[Application Packager] - Packaging ended with errors:.");
System.out.println("[Application Packager] - ERROR: "+execution_result.getExceptions().get(i).getMessage());
}
else
System.out.println("[Application Packager] - Packaging ended successfully.");
copyFile(new File(sourcePath+"/target/"+fileName), new File(destination_path+fileName));
}
......
......@@ -18,11 +18,11 @@ public class UAPP {
File directoryToZip = new File(sourcePath);
List<File> fileList = new ArrayList<File>();
System.out.println("---Getting references to all files in: " + directoryToZip.getCanonicalPath());
System.out.println("[Application Packager] - Getting references to all files in: " + directoryToZip.getCanonicalPath());
getAllFiles(directoryToZip, fileList);
System.out.println("---Creating zip file");
System.out.println("[Application Packager] - Creating zip file");
writeZipFile(destinationPath, directoryToZip, fileList);
System.out.println("---Done");
System.out.println("[Application Packager] - Done");
}
catch(Exception ex){
ex.printStackTrace();
......@@ -36,10 +36,10 @@ public class UAPP {
for (File file : files) {
fileList.add(file);
if (file.isDirectory()) {
System.out.println("directory:" + file.getCanonicalPath());
System.out.println("[Application Packager] - directory:" + file.getCanonicalPath());
getAllFiles(file, fileList);
} else {
System.out.println(" file:" + file.getCanonicalPath());
System.out.println(" [Application Packager] - file:" + file.getCanonicalPath());
}
}
} catch (IOException e) {
......@@ -76,7 +76,7 @@ public class UAPP {
// we want the zipEntry's path to be a relative path that is relative
// to the directory being zipped, so chop off the rest of the path
String zipFilePath = file.getCanonicalPath().substring(directoryToZip.getCanonicalPath().length() + 1, file.getCanonicalPath().length());
System.out.println("Writing '" + zipFilePath + "' to zip file");
System.out.println("[Application Packager] - Writing '" + zipFilePath + "' to zip file");
ZipEntry zipEntry = new ZipEntry(zipFilePath);
zos.putNextEntry(zipEntry);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment