Skip to content

Commit 6a15635

Browse files
committed
Fix file system watching incompatibility with project cache dir
Explicitly disable org.gradle.vfs.watch in buildpack gradle.properties to prevent build failures when users have org.gradle.vfs.watch=true in their project gradle.properties, which is incompatible with org.gradle.projectcachedir.
1 parent 0596186 commit 6a15635

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

bin/compile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ cat <<-EOF >"${GRADLE_USER_HOME}/gradle.properties"
6969
org.gradle.welcome=never
7070
org.gradle.caching=true
7171
org.gradle.projectcachedir=${CACHE_DIR}/.gradle-project
72+
# Disable file system watching because org.gradle.vfs.watch is incompatible with
73+
# org.gradle.projectcachedir. This prevents build failures when users have
74+
# org.gradle.vfs.watch=true in their project gradle.properties.
75+
org.gradle.vfs.watch=false
7276
EOF
7377

7478
# We're adding custom tasks to support buildpack functionality via a Gradle init script.

test/spec/misc_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
end
180180
end
181181

182-
it 'builds successfully with file system watching enabled via gradle.properties' do
182+
it 'builds successfully when user enables file system watching via gradle.properties' do
183183
app = Hatchet::Runner.new('simple-http-service-gradle-8-groovy')
184184
app.before_deploy do
185185
File.write('gradle.properties', <<~PROPERTIES)
@@ -190,6 +190,7 @@
190190

191191
app.deploy do
192192
expect(app).to be_deployed
193+
expect(clean_output(app.output)).not_to include('Enabling file system watching via --watch-fs (or via the org.gradle.vfs.watch property) with --project-cache-dir also specified is not supported; remove either option to fix this problem')
193194
end
194195
end
195196
end

0 commit comments

Comments
 (0)