diff --git a/build.gradle b/build.gradle
index ecf56343d7171db9c725dece03fc42d53acb5713..04af1df4979b0bf3fcfe1b72eae2080630b25872 100644
--- a/build.gradle
+++ b/build.gradle
@@ -15,7 +15,7 @@ sourceSets {
     }
 }
 
-ant.properties["org.eventb.core.ast.home"] = "."
+ant.properties["org.eventb.core.ast.home"] = projectDir.toString()
 ant.importBuild 'tom/tom-task.xml'
 
 task tom() << {
@@ -23,7 +23,7 @@ task tom() << {
           classpath: ant.references['tom.classpath'],
           srcdir: 'src',
           destdir: 'src',
-          options: "-I ./tom",
+          options: "-I ${projectDir}/tom",
           pretty: 'true',
           optimize: 'true') {
               include(name: '**/*.t')
diff --git a/tom/tom-task.xml b/tom/tom-task.xml
index 358de65b706a53221f97505dc7cafdeaeccca3db..3f1205a99f223313e0784ef1d5dc29c9ffcb4c8e 100644
--- a/tom/tom-task.xml
+++ b/tom/tom-task.xml
@@ -28,7 +28,7 @@
 	</description>
 
 	<property name="tom.home"
-		location="${org.eventb.core.ast.home}/../tools/tom-2.8" />
+		location="${org.eventb.core.ast.home}/tools/tom-2.8" />
 	<path id="tom.classpath">
 		<fileset dir="${tom.home}/lib">
 			<include name="**/*.jar"/>