From d419157f80784e6f7533683f4294fa496b888dec Mon Sep 17 00:00:00 2001 From: David Sugar <32524063+tst-dsugar@users.noreply.github.com> Date: Mon, 11 Dec 2017 12:59:36 -0500 Subject: [PATCH] Passing build info from scons to gradle RPM build (#627) * groovy...passing build info from scons * properties parser --- .gitignore | 1 + earth_enterprise/SConstruct | 4 ++++ earth_enterprise/rpms/.gitignore | 1 + earth_enterprise/rpms/build.gradle | 12 +++++++++++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2530b0ec33..c30ac0c448 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ earth_enterprise/tutorial/FusionTutorial/KML /*.creator.user /*.files /*.includes + diff --git a/earth_enterprise/SConstruct b/earth_enterprise/SConstruct index 6d30f83856..10a36eb3ac 100644 --- a/earth_enterprise/SConstruct +++ b/earth_enterprise/SConstruct @@ -26,6 +26,10 @@ EnsureSConsVersion(0, 96, 92) # process commandline arguments installdir = ARGUMENTS.get('installdir', '/tmp/fusion_os_install') +with open('rpms/build.properties', 'w') as f: + print >> f, "## Auto-generated file from scons." + print >> f, "## Manual changes will be overwritten." + print >> f, str('staged=') + installdir.strip() installdir = Dir(installdir) def dir_cat(installdir, subdir1, subdir2): diff --git a/earth_enterprise/rpms/.gitignore b/earth_enterprise/rpms/.gitignore index 91ea7410d8..040d3ba1a5 100644 --- a/earth_enterprise/rpms/.gitignore +++ b/earth_enterprise/rpms/.gitignore @@ -1,2 +1,3 @@ build +build.properties .gradle diff --git a/earth_enterprise/rpms/build.gradle b/earth_enterprise/rpms/build.gradle index 21e554c214..68958a11a4 100644 --- a/earth_enterprise/rpms/build.gradle +++ b/earth_enterprise/rpms/build.gradle @@ -55,8 +55,18 @@ def openGeeVersion = it // The first string that remains is the version string. } +def stagedInstall_path = '/tmp/fusion_os_install' +if (new File('build.properties').exists()) { + def props = new Properties() + new File('build.properties').withInputStream { + props.load(it) + } + if(props["staged"]) { + stagedInstall_path = props["staged"] + } +} -def stagedInstallDir = new File('/tmp/fusion_os_install') +def stagedInstallDir = new File(stagedInstall_path) def stagedInstallDir_common = new File(stagedInstallDir, 'common') def stagedInstallDir_common_opt = new File(stagedInstallDir, 'common/opt') def stagedInstallDir_common_user_magic =