From 9f21bc6de668ae11feb6a19e878c3194bce43766 Mon Sep 17 00:00:00 2001
From: dgelessus <dgelessus@users.noreply.github.com>
Date: Wed, 4 Oct 2023 16:21:25 +0200
Subject: [PATCH] Set home property for tom-task correctly

This allows reverting the undocumented change to tom-task.xml and also
fixes a mysterious sporadic issue with tom not finding the include files
(probably related to the Gradle daemon).
---
 build.gradle     | 4 ++--
 tom/tom-task.xml | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/build.gradle b/build.gradle
index ecf5634..04af1df 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 358de65..3f1205a 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"/>
-- 
GitLab