Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Build config updates

Rich Turner94c79a9874fd
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 29e21193f..70a6105b0 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -152,10 +152,12 @@ jobs:
secrets = json.loads(os.getenv('secret'))
for key, value in secrets.items():
if key.startswith("_"):
- if not key.startswith("_" + os.getenv('environment') + "_"):
+ environment = os.getenv('environment').upper()
+ prefix = "_" + environment + "_"
+ if not key.startswith(prefix):
continue
else:
- key = key.lstrip("_" + os.getenv('environment') + "_")
+ key = key.lstrip(prefix)
print(f"Setting {key} ...")
lines = len(value.split("\n"))
if lines > 1:
diff --git a/project.gradle b/project.gradle
index 33bcce8cf..0772cb0e3 100644
--- a/project.gradle
+++ b/project.gradle
@@ -166,12 +166,31 @@ def getYarnInstallTask() {
}
}
+// Gets the list of runtime JAR dependencies; can be used in custom project deployment installDist task to populate
+// extensions directory
+def getDeploymentJars() {
+ if (project.configurations.find { it.name == "runtimeClasspath" } == null) {
+ return null;
+ }
+
+ // Get all dependencies that are already part of the openremote manager and exclude these from the libs dir
+ // otherwise they will appear on the classpath twice (once in manager app dir and then again in extensions)
+ def excludeDependencies = resolveProject(":manager").configurations.runtimeClasspath.resolvedConfiguration.resolvedArtifacts
+
+ return project.configurations.runtimeClasspath.resolvedConfiguration.resolvedArtifacts.findAll {
+ dep -> excludeDependencies.find { it == dep } == null && dep.name != "openremote-manager" }.collect {
+ println "CopyLibs Artifact: ${it.file.path}"
+ return it.file
+ }
+}
+
ext {
resolvePath = this.&resolvePath
resolveProject = this.&resolveProject
resolveTask = this.&resolveTask
isCustomProject = this.&isCustomProject
getYarnInstallTask = this.&getYarnInstallTask
+ getDeploymentJars = this.&getDeploymentJars
}
if (project.convention.findPlugin(JavaPluginConvention)) {
@@ -238,23 +257,6 @@ task tscWatch(type: Exec) {
commandLine npmCommand("npx"), "tsc", "-b", "--watch"
}
-// A task for copying a custom java projects libs that aren't part of the manager dependencies
-task copyLibs {
- doLast {
-
- if (project.configurations.find { it.name == "runtimeClasspath" } != null) {
- // Get all dependencies that are already part of the openremote manager and exclude these from the libs dir
- // otherwise they will appear on the classpath twice (once in manager app dir and then again in extensions)
- def excludeDependencies = resolveProject(":manager").configurations.runtimeClasspath.resolvedConfiguration.resolvedArtifacts
- def customLibs = project.configurations.runtimeClasspath.resolvedConfiguration.resolvedArtifacts.findAll { dep -> excludeDependencies.find { it == dep } == null && dep.name != "openremote-manager" }.collect { it.file }
- copy {
- from customLibs
- into "${project.buildDir}/image/manager/extensions"
- }
- }
- }
-}
-
// Configure Java build
plugins.withType(JavaPlugin).whenPluginAdded {