Skip to content

Commit e9233dd

Browse files
committed
obfuscate java file names in gradle test app
1 parent d32eb22 commit e9233dd

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

graalpython/com.oracle.graal.python.test/src/tests/standalone/test_standalone.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,17 @@ def empty_packages(self):
204204
pass
205205

206206
def generate_app(self, tmpdir, target_dir):
207-
shutil.copytree(os.path.join(os.path.dirname(__file__), "gradle", "gradle-test-project"), target_dir)
207+
src_prj_path = os.path.join(os.path.dirname(__file__), "gradle", "gradle-test-project")
208+
for root, dirs, files in os.walk(src_prj_path):
209+
for file in files:
210+
source_file = os.path.join(root, file)
211+
if file.endswith(".j"):
212+
file = file[0:len(file)- 1] + "java"
213+
target_root = os.path.join(target_dir, root[len(src_prj_path) + 1:])
214+
target_file = os.path.join(target_root, file)
215+
os.makedirs(os.path.dirname(target_file), exist_ok=True)
216+
shutil.copyfile(source_file, target_file)
217+
208218
self.copy_build_files(target_dir)
209219

210220
@unittest.skipUnless(is_gradle_enabled, "ENABLE_GRADLE_STANDALONE_UNITTESTS is not true")

0 commit comments

Comments
 (0)