Skip to content

Commit

Permalink
Merge pull request #731 from kbase/dev-gradle2_upstream
Browse files Browse the repository at this point in the history
Add schema updater script build
  • Loading branch information
MrCreosote authored Apr 17, 2024
2 parents 19117a4 + a4f5350 commit 7e58b12
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ var BUILD_OTHER_DOC_DIR = "$BUILD_DOC_ROOT/otherdoc/"
var IN_JAR_DOC_DIR = "/server_docs"
var IN_JAR_JAVA_DOC_DIR = "$IN_JAR_DOC_DIR/javadoc"

// TODO NOW schema updater script - commit 5
// TODO NOW sdk-compile all, java, and docs - commit 6
// TODO NOW handle the git commit the same way as auth does - commit 7
// TODO NOW delete build.xml and Makefile - commit 8
// TODO NOW run tests from Eclipse w/o specifying classpath manually & remove sourceSets & claspath - commit 9
// TODO NOW update any ant refs in docs to gradle
// TODO NOW update any ant refs in docs to gradle & the update schema script build & location

repositories {
mavenCentral()
Expand Down Expand Up @@ -178,6 +177,27 @@ war {
from(BUILD_OTHER_DOC_DIR) { into "/WEB-INF/classes/$IN_JAR_DOC_DIR" }
}

task generateUpdateSchemaScript {
dependsOn compileJava
doLast {
def dependencies = configurations.runtimeClasspath.collect { File file ->
file.absolutePath
}

def classpath = dependencies.join(':')

def scriptContent = """#!/bin/sh
CLASSPATH=$classpath
java -cp $buildDir/classes/java/main:\$CLASSPATH us.kbase.workspace.kbase.SchemaUpdaterCLI \$@
"""
def outfile = "$buildDir/update_workspace_database_schema"
file(outfile).text = scriptContent
file(outfile).setExecutable(true)
}
}

// Custom java project layout
sourceSets {
main {
Expand Down

0 comments on commit 7e58b12

Please sign in to comment.