Skip to content

Commit

Permalink
[scripts] allow running against basic DB from source.
Browse files Browse the repository at this point in the history
get_classpath_from_maven(database) now does not alter the project name
before giving it to Maven. main() now calculates the db_dir with core
and uses the core project for Maven, otherwise things work as they did
before.

fixes brianfrankcooper#336
  • Loading branch information
kruthar committed Oct 14, 2015
1 parent 57b2291 commit b92c573
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions bin/ycsb
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ def is_distribution():
# presumes maven properly handles system-specific path separators
def get_classpath_from_maven(database):
try:
debug("Running 'mvn -pl com.yahoo.ycsb:"+database+"-binding -am package -DskipTests "
debug("Running 'mvn -pl com.yahoo.ycsb:"+database+" -am package -DskipTests "
"dependency:build-classpath -DincludeScope=compile -Dmdep.outputFilterFile=true'")
mvn_output = subprocess.check_output(["mvn", "-pl", "com.yahoo.ycsb:"+database+"-binding",
mvn_output = subprocess.check_output(["mvn", "-pl", "com.yahoo.ycsb:" + database,
"-am", "package", "-DskipTests",
"dependency:build-classpath",
"-DincludeScope=compile",
Expand Down Expand Up @@ -200,12 +200,14 @@ def main():
warn("Running against a source checkout. In order to get our runtime "
"dependencies we'll have to invoke Maven. Depending on the state "
"of your system, this may take ~30-45 seconds")
db_dir = os.path.join(ycsb_home, binding)
db_location = "core" if binding == "basic" else binding
project = "core" if binding == "basic" else binding + "-binding"
db_dir = os.path.join(ycsb_home, db_location)
# goes first so we can rely on side-effect of package
maven_says = get_classpath_from_maven(binding)
maven_says = get_classpath_from_maven(project)
# TODO when we have a version property, skip the glob
cp = find_jars(os.path.join(db_dir, "target"),
binding + "-binding*.jar")
project + "*.jar")
# alredy in jar:jar:jar form
cp.append(maven_says)
cp.insert(0, os.path.join(db_dir, "conf"))
Expand Down

0 comments on commit b92c573

Please sign in to comment.