Skip to content

Commit

Permalink
Merge pull request #12 from sarahtattersall/develop
Browse files Browse the repository at this point in the history
Bug fix for #10 and maven integration
  • Loading branch information
Sarah Tattersall committed Oct 10, 2013
2 parents 47bbef0 + a8ac05a commit 2c86e70
Show file tree
Hide file tree
Showing 908 changed files with 481 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
# Maven
log/
target/

#PIPE
PipeTestFile.xml
48 changes: 43 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,50 @@ code efficiency improvements and added zoom to the GUI and reachability graph ge


## Installation ##
In order to run PIPE tool execute the following for your operating system from within the PIPE root directory
### Once only ###
PIPEv4.3.0 makes use of Maven as a dependency manager and build system. Currently it makes use of a few
internal libraries located in ```src/libs```. To install these for use with Maven there is a Python script
```mvn_libs/add_maven_dependencies.py``` to install these to your Maven local repository. It takes one command line
argument which is the path to the ```jar``` files.
It makes use of the libs declared in ```mvn_libs/internal_libs.json``` which is a JSON object of the format:

### Linux ###
{
...
<jar_basename> : {
"artifactId" : <artifact_name>,
"version" : <version_number>
},
...
}

./launch.sh
For example

### Windows ###
{
"Jama-1.0.2" : {
"artifactId" : "jama",
"version" : "1.0.2"
},
...
}

If you add any other internal ```jar``` files. Make sure they follow the same format as this.
To run this script execute the following:

$ cd mvn_libs
$ python add_maven_dependencies.py ../src/lib/



### Build jar ###
To build the ```jar``` library execute the following from within the PIPE root directory:

$ mvn install

Once finished you should see the file ```target/PIPE-4.3.0.jar```.


### Execution ###
In order to run PIPE tool execute the following from within the PIPE root directory:

$ mvn exec:java

./launch.bat
69 changes: 69 additions & 0 deletions mvn_libs/add_maven_dependencies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import os
import json

# Loads JSON internal_libs.json file
def get_internal_libs():
json_data=open('internal_libs.json')
data = json.load(json_data)
json_data.close()

for (key, value) in data.iteritems():
print key

return data

def getMavenInstallCall(libFile, artifactId, versionId):
commandLineCall = "mvn install:install-file"
groupIdArg = "-DgroupId=uk.ac.imperial"
packgingArg = "-Dpackaging=jar"

fileArg = "-Dfile=" + libFile
artifactIdArg = "-DartifactId=" + artifactId
versionArg = "-Dversion=" + versionId

commandLine = (" ").join([commandLineCall,
fileArg,
groupIdArg,
artifactIdArg,
versionArg,
packgingArg])

return commandLine


# Expects data in format
# { <jar_name> : { artifactId : <artifact>, version : <version>}, ...}
def process_libs(libs, path):

for (lib, value) in libs.iteritems():
libFile = path + "/" + lib + ".jar"
commandLine = getMavenInstallCall(libFile, value.get('artifactId'), value.get('version'))
os.system(commandLine)

def print_pom_dependencies(libs):
dependencyOpenTag = '<dependency>'
dependencyCloseTag='</dependency>'
groupIDTag = '<groupId>uk.ac.imperial</groupId>'
for (lib, value) in libs.iteritems():
artifactIdTag = '<artifactId>' + value.get('artifactId') + '</artifactId>'
versionTag = '<version>' + value.get('version') + '</version>'

dependency = ('\n').join([dependencyOpenTag,
" " + groupIDTag,
" " + artifactIdTag,
" " + versionTag,
dependencyCloseTag])
print dependency
print

if __name__ == '__main__':
import sys
if (len(sys.argv) < 2):
print "Please enter library locations"
sys.exit(1)

libData = get_internal_libs();
process_libs(libData, sys.argv[1])

print "DEPENDENCIES TO INCLUDE IN POM.XML:"
print_pom_dependencies(libData)
78 changes: 78 additions & 0 deletions mvn_libs/internal_libs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"Jama-1.0.2" : {
"artifactId" : "jama",
"version" : "1.0.2"
},
"abbot" : {
"artifactId" : "abbot",
"version" : "1.0"
},
"commons-logging-1.1" : {
"artifactId" : "commons-logging",
"version" : "1.1"
},
"drmaa" : {
"artifactId" : "drmaa",
"version" : "1.0"
},
"hadoop-0.13.1-dev-core" : {
"artifactId" : "hadoop-dev-core",
"version" : "0.13.1"
},
"jcommon-1.0.10" : {
"artifactId" : "jcommon",
"version" : "1.0.10"
},
"jfreechart-1.0.6" : {
"artifactId" : "jfreechart",
"version" : "1.0.6"
},
"jpowergraph-0.2-common" : {
"artifactId" : "jpowergraph-common",
"version" : "0.2"
},
"jpowergraph-0.2-swing" : {
"artifactId" : "jpowergraph-swing",
"version" : "0.2"
},
"log4j-1.2.13" : {
"artifactId" : "log4j",
"version" : "1.2.13"
},
"netcdf-4.2" : {
"artifactId" : "netcdf",
"version" : "4.2"
},
"poi-3.7-20101029" : {
"artifactId" : "poi",
"version" : "3.7"
},
"poi-examples-3.7-20101029" : {
"artifactId" : "poi-examples",
"version" : "3.7"
},
"poi-ooxml-3.7-20101029" : {
"artifactId" : "poi-ooxml",
"version" : "3.7"
},
"poi-ooxml-schemas-3.7-20101029" : {
"artifactId" : "poi-ooxml-schemas",
"version" : "3.7"
},
"poi-scratchpad-3.7-20101029" : {
"artifactId" : "poi-scratchpad",
"version" : "3.7"
},
"powerswing-0.3" : {
"artifactId" : "powerswing",
"version" : "0.3"
},
"tools" : {
"artifactId" : "tools",
"version" : "1.0"
},
"xmlunit-1.4" : {
"artifactId" : "xmlunit",
"version" : "1.4"
}
}
153 changes: 153 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>uk.ac.imperial</groupId>
<artifactId>PIPE</artifactId>
<version>4.3.0</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>Pipe</mainClass>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>maven</groupId>
<artifactId>maven-abbot-plugin</artifactId>
<version>1.1</version>
</dependency>

<dependency>
<groupId>uk.ac.imperial</groupId>
<artifactId>tools</artifactId>
<version>1.0</version>
</dependency>

<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<version>1.4</version>
</dependency>

<dependency>
<groupId>uk.ac.imperial</groupId>
<artifactId>hadoop-dev-core</artifactId>
<version>0.13.1</version>
</dependency>

<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
</dependency>

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.7</version>
</dependency>

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.7</version>
</dependency>

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.7</version>
</dependency>

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.7</version>
</dependency>

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-examples</artifactId>
<version>3.7</version>
</dependency>

<dependency>
<groupId>uk.ac.imperial</groupId>
<artifactId>drmaa</artifactId>
<version>1.0</version>
</dependency>

<dependency>
<groupId>jfree</groupId>
<artifactId>jfreechart</artifactId>
<version>1.0.0</version>
</dependency>

<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>


<dependency>
<groupId>jfree</groupId>
<artifactId>jcommon</artifactId>
<version>1.0.16</version>
</dependency>

<dependency>
<groupId>uk.ac.imperial</groupId>
<artifactId>jama</artifactId>
<version>1.0.2</version>
</dependency>

<dependency>
<groupId>uk.ac.imperial</groupId>
<artifactId>powerswing</artifactId>
<version>0.3</version>
</dependency>

<dependency>
<groupId>uk.ac.imperial</groupId>
<artifactId>jpowergraph-swing</artifactId>
<version>0.2</version>
</dependency>

<dependency>
<groupId>uk.ac.imperial</groupId>
<artifactId>jpowergraph-common</artifactId>
<version>0.2</version>
</dependency>

<dependency>
<groupId>edu.ucar</groupId>
<artifactId>netcdf</artifactId>
<version>4.2</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>


</project>
Binary file removed src/lib/abbot.jar
Binary file not shown.
Binary file removed src/lib/commons-logging-1.1.jar
Binary file not shown.
Binary file removed src/lib/jcommon-1.0.10.jar
Binary file not shown.
Binary file removed src/lib/jfreechart-1.0.6.jar
Binary file not shown.
Binary file removed src/lib/log4j-1.2.13.jar
Binary file not shown.
Binary file removed src/lib/netcdf-4.2.jar
Binary file not shown.
Binary file removed src/lib/poi-3.7-20101029.jar
Binary file not shown.
Binary file removed src/lib/poi-examples-3.7-20101029.jar
Binary file not shown.
Binary file removed src/lib/poi-ooxml-3.7-20101029.jar
Binary file not shown.
Binary file removed src/lib/poi-ooxml-schemas-3.7-20101029.jar
Binary file not shown.
Binary file removed src/lib/poi-scratchpad-3.7-20101029.jar
Binary file not shown.
Binary file removed src/lib/xmlunit-1.4.jar
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 2c86e70

Please sign in to comment.