Skip to content

Commit

Permalink
Add publish to local .polypheny task
Browse files Browse the repository at this point in the history
  • Loading branch information
vogti committed Sep 16, 2024
1 parent 4f3afac commit bba5acd
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,36 @@ tasks.register('packageDistribution', Zip) {
destinationDirectory = file('publish')
from file('dist')
}
packageDistribution.dependsOn('build')


import org.apache.tools.ant.taskdefs.condition.Os

task publishToDotPolypheny {
def polyphenyHome
def uiSubfolder = "ui/"

// Check if the environment variable POLYPHENY_HOME exists
if (System.getenv("POLYPHENY_HOME")) {
polyphenyHome = System.getenv("POLYPHENY_HOME")
} else {
// Fallback to the user's home directory with .polypheny folder
polyphenyHome = new File(System.getProperty("user.home"), ".polypheny").absolutePath
}

def targetDir = new File(polyphenyHome, uiSubfolder)
targetDir.mkdirs()

doLast {
println "Copying UI files to: ${targetDir.absolutePath}"
def sourceDir = file("dist/")
copy {
from sourceDir
into targetDir
}
}
}
publishToDotPolypheny.dependsOn('packageDistribution')

// Add install task
task install(group: 'other', dependsOn: publishToDotPolypheny)

0 comments on commit bba5acd

Please sign in to comment.