Index: Jenkinsfile
===================================================================
--- Jenkinsfile	(revision f51ef6f2a83bb47a27c0f328456fa9e017b3e998)
+++ Jenkinsfile	(revision 9beae231a8f66079cf0a0e4ba3042a55aa7470dd)
@@ -2,151 +2,9 @@
 
 //===========================================================================================================
-// Main compilation routines
-//===========================================================================================================
-//Compilation script is done here but environnement set-up and error handling is done in main loop
-def cfa_build(boolean full_build, String flags) {
-	build_stage 'Checkout'
-		def install_dir = pwd tmp: true
-		//checkout the source code and clean the repo
-		checkout scm
-
-		//Clean all temporary files to make sure no artifacts of the previous build remain
-		sh 'git clean -fdqx'
-
-		//Reset the git repo so no local changes persist
-		sh 'git reset --hard'
-
-	build_stage 'Build'
-
-		//Configure the conpilation (Output is not relevant)
-		//Use the current directory as the installation target so nothing
-		//escapes the sandbox
-		//Also specify the compiler by hand
-		sh "./configure CXX=${currentCC.cpp_cc} ${flags} --with-backend-compiler=${currentCC.cfa_backend_cc} --prefix=${install_dir} --enable-silent-rules --quiet"
-
-		//Compile the project
-		sh 'make -j 8 --no-print-directory V=0 install'
-
-	build_stage 'Test'
-
-		//Run the tests from the tests directory
-		if (full_build) {
-			sh 'make -C src/tests all-tests debug=yes'
-			sh 'make -C src/tests all-tests debug=no'
-		}
-		else {
-			sh 'make -C src/tests'
-		}
-
-	build_stage 'Cleanup'
-
-		//do a maintainer-clean to make sure we need to remake from scratch
-		sh 'make maintainer-clean > /dev/null'
-}
-
-def make_doc() {
-	def err = null
-
-	try {
-		sh 'make clean > /dev/null'
-		sh 'make > /dev/null 2>&1'
-	}
-
-	catch (Exception caughtError) {
-		//rethrow error later
-		err = caughtError
-
-		sh 'cat *.log'
-	}
-
-	finally {
-		/* Must re-throw exception to propagate error */
-		if (err) {
-			throw err
-		}
-	}
-}
-
-def doc_build() {
-	stage 'Documentation'
-
-		status_prefix = 'Documentation'
-
-		dir ('doc/user') {
-			make_doc()
-		}
-
-		dir ('doc/refrat') {
-			make_doc()
-		}
-}
-
-def benchmark() {
-	stage 'Benchmark'
-
-		status_prefix = 'Documentation'
-
-		// //We can't just write to a file outside our repo
-		// //Copy the file locally using ssh
-		// sh 'scp plg2.cs.uwaterloo.ca:/u/cforall/public_html/perf-history/concurrency.csv bench.csv'
-
-		// //Then append to the local file
-		// sh 'make -C src/benchmark csv-data >> bench.csv'
-
-		// //Then publish the file again
-		// sh 'scp bench.csv plg2.cs.uwaterloo.ca:/u/cforall/public_html/perf-history/concurrency.csv'		
-}
-
-//===========================================================================================================
-// Helper classes/variables/routines to make the status and stage name easier to use
-//===========================================================================================================
-//Description of a compiler (Must be serializable since pipelines are persistent)
-class CC_Desc implements Serializable {
-	public String cc_name
-	public String cpp_cc
-	public String cfa_backend_cc
-
-	CC_Desc(String cc_name, String cpp_cc, String cfa_backend_cc) {
-		this.cc_name = cc_name
-		this.cpp_cc = cpp_cc
-		this.cfa_backend_cc = cfa_backend_cc
-	}
-}
-
-//Global Variables defining the compiler and at which point in the build we are
-// These variables are used but can't be declared before hand because of wierd scripting rules
-// @Field String currentCC
-// @Field String status_prefix
-
-//Wrapper to sync stage name and status name
-def build_stage(String name) {
-	def stage_name = "${currentCC.cc_name} ${name}".trim()
-	stage stage_name
-
-		status_prefix = stage_name
-}
-
-//Helper routine to collect information about the git history
-def collect_git_info() {
-
-	//create the temporary output directory in case it doesn't already exist
-	def out_dir = pwd tmp: true
-	sh "mkdir -p ${out_dir}"
-
-	//parse git logs to find what changed
-	gitRefName = env.BRANCH_NAME
-	dir("../${gitRefName}@script") {
-		sh "git reflog > ${out_dir}/GIT_COMMIT"
-	}
-	git_reflog = readFile("${out_dir}/GIT_COMMIT")
-	gitRefOldValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][1]
-	gitRefNewValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][2]
-}
-
-//===========================================================================================================
 // Main loop of the compilation
 //===========================================================================================================
 node ('master'){
 
+	boolean bIsSandbox = env.BRANCH_NAME == "jenkins-sandbox"
 	boolean bIsFullBuild
 	def err = null
@@ -156,5 +14,5 @@
 
 	try {
-		//Prevent the build from exceeding 30 minutes
+		//Prevent the build from exceeding 60 minutes
 		timeout(60) {
 
@@ -180,5 +38,4 @@
 					]])
 
-				bIsSandbox = env.BRANCH_NAME == "jenkins-sandbox"
 				bIsFullBuild = isFullBuild == 'true'
 				architectureFlag = ''
@@ -246,4 +103,147 @@
 
 //===========================================================================================================
+// Helper classes/variables/routines to make the status and stage name easier to use
+//===========================================================================================================
+//Description of a compiler (Must be serializable since pipelines are persistent)
+class CC_Desc implements Serializable {
+	public String cc_name
+	public String cpp_cc
+	public String cfa_backend_cc
+
+	CC_Desc(String cc_name, String cpp_cc, String cfa_backend_cc) {
+		this.cc_name = cc_name
+		this.cpp_cc = cpp_cc
+		this.cfa_backend_cc = cfa_backend_cc
+	}
+}
+
+//Global Variables defining the compiler and at which point in the build we are
+// These variables are used but can't be declared before hand because of wierd scripting rules
+// @Field String currentCC
+// @Field String status_prefix
+
+//Wrapper to sync stage name and status name
+def build_stage(String name) {
+	def stage_name = "${currentCC.cc_name} ${name}".trim()
+	stage stage_name
+
+		status_prefix = stage_name
+}
+
+//Helper routine to collect information about the git history
+def collect_git_info() {
+
+	//create the temporary output directory in case it doesn't already exist
+	def out_dir = pwd tmp: true
+	sh "mkdir -p ${out_dir}"
+
+	//parse git logs to find what changed
+	gitRefName = env.BRANCH_NAME
+	dir("../${gitRefName}@script") {
+		sh "git reflog > ${out_dir}/GIT_COMMIT"
+	}
+	git_reflog = readFile("${out_dir}/GIT_COMMIT")
+	gitRefOldValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][1]
+	gitRefNewValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][2]
+}
+
+//===========================================================================================================
+// Main compilation routines
+//===========================================================================================================
+//Compilation script is done here but environnement set-up and error handling is done in main loop
+def cfa_build(boolean full_build, String flags) {
+	build_stage 'Checkout'
+		def install_dir = pwd tmp: true
+		//checkout the source code and clean the repo
+		checkout scm
+
+		//Clean all temporary files to make sure no artifacts of the previous build remain
+		sh 'git clean -fdqx'
+
+		//Reset the git repo so no local changes persist
+		sh 'git reset --hard'
+
+	build_stage 'Build'
+
+		//Configure the conpilation (Output is not relevant)
+		//Use the current directory as the installation target so nothing
+		//escapes the sandbox
+		//Also specify the compiler by hand
+		sh "./configure CXX=${currentCC.cpp_cc} ${flags} --with-backend-compiler=${currentCC.cfa_backend_cc} --prefix=${install_dir} --enable-silent-rules --quiet"
+
+		//Compile the project
+		sh 'make -j 8 --no-print-directory V=0 install'
+
+	build_stage 'Test'
+
+		//Run the tests from the tests directory
+		if (full_build) {
+			sh 'make -C src/tests all-tests debug=yes'
+			sh 'make -C src/tests all-tests debug=no'
+		}
+		else {
+			sh 'make -C src/tests'
+		}
+
+	build_stage 'Cleanup'
+
+		//do a maintainer-clean to make sure we need to remake from scratch
+		sh 'make maintainer-clean > /dev/null'
+}
+
+def make_doc() {
+	def err = null
+
+	try {
+		sh 'make clean > /dev/null'
+		sh 'make > /dev/null 2>&1'
+	}
+
+	catch (Exception caughtError) {
+		//rethrow error later
+		err = caughtError
+
+		sh 'cat *.log'
+	}
+
+	finally {
+		/* Must re-throw exception to propagate error */
+		if (err) {
+			throw err
+		}
+	}
+}
+
+def doc_build() {
+	stage 'Documentation'
+
+		status_prefix = 'Documentation'
+
+		dir ('doc/user') {
+			make_doc()
+		}
+
+		dir ('doc/refrat') {
+			make_doc()
+		}
+}
+
+def benchmark() {
+	stage 'Benchmark'
+
+		status_prefix = 'Documentation'
+
+		// //We can't just write to a file outside our repo
+		// //Copy the file locally using ssh
+		// sh 'scp plg2.cs.uwaterloo.ca:/u/cforall/public_html/perf-history/concurrency.csv bench.csv'
+
+		// //Then append to the local file
+		// sh 'make -C src/benchmark csv-data >> bench.csv'
+
+		// //Then publish the file again
+		// sh 'scp bench.csv plg2.cs.uwaterloo.ca:/u/cforall/public_html/perf-history/concurrency.csv'		
+}
+
+//===========================================================================================================
 //Routine responsible of sending the email notification once the build is completed
 //===========================================================================================================
