Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Commit

Permalink
add FS prefix for clarity inside build script
Browse files Browse the repository at this point in the history
  • Loading branch information
Costin Leau committed Nov 29, 2012
1 parent b225fab commit 732c99f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -81,9 +81,9 @@ For its testing, Spring for Apache Hadoop expects a pseudo-distributed/local Had
the project classpath to be automatically used by the Hadoop job tracker. These settings can be customized in two ways:
* Build properties

From the command-line, use `hd.fs` for the file-system, `hd.jt` for the jobtracker and `hd.hive` for the Hive host/port information, to override the defaults. For example to run against HDFS at `dumbo:8020` one would use:
From the command-line, use `hd.fs` for the file-system (to avoid confusion, specify the protocol such as 'hdfs://', 's3://', etc - if none is specified, `hdfs://` will be used), `hd.jt` for the jobtracker and `hd.hive` for the Hive host/port information, to override the defaults. For example to run against HDFS at `dumbo:8020` one would use:

gradlew -Phd.fs=dumbo:8020 build
gradlew -Phd.fs=hdfs://dumbo:8020 build

* Properties file

Expand Down
16 changes: 14 additions & 2 deletions build.gradle
Expand Up @@ -224,6 +224,7 @@ test {
systemProperties['output.path'] = 'build/classes/test/output'
includes = ["**/*.class"]


doFirst() {
ext.msg = ""

Expand All @@ -248,11 +249,22 @@ test {

if (!msg.isEmpty())
println "Skipping [$msg] Tests";

// check prefix for hd.fs
// first copy the properties since we can't change them
ext.projProps = project.properties

if (projProps.containsKey("hd.fs")) {
String hdfs = projProps["hd.fs"].toString()
if (!hdfs.contains("://")) {
projProps.put("hd.fs", "hdfs://" + hdfs)
}
}

// due to GRADLE-2475, set the system properties manually
project.properties.each { k,v ->
projProps.each { k,v ->
if (k.toString().startsWith("hd.")) {
systemProperties[k] = project[k]
systemProperties[k] = projProps[k]
}
}
}
Expand Down

0 comments on commit 732c99f

Please sign in to comment.