Skip to content
代码片段 群组 项目
提交 61fddaf8 编辑于 作者: Luke Cwik's avatar Luke Cwik
浏览文件

Enable configuraton on demand by default

Get ApexYarnLauncher test to pass by fixing gradle dependency tree to look like maven one
Revert changes to ApexYarnLauncher
上级 41d466bc
No related branches found
No related tags found
无相关合并请求
......@@ -16,3 +16,4 @@
# limitations under the License.
################################################################################
org.gradle.parallel=true
org.gradle.configureondemand=true
......@@ -55,14 +55,21 @@ dependencies {
// TODO: Update this so that the generated file is added to the explicitly added instead of
// just outputting the file in the correct path.
task buildDependencyTree(type: DependencyReportTask) {
configurations = [project.configurations.runtimeClasspath]
configurations = [project.configurations.testRuntimeClasspath]
outputFile = new File(buildDir, "classes/java/main/org/apache/beam/runners/apex/dependency-tree")
// TODO: Migrate ApexYarnLauncher to use the Gradles dependency tree output instead of Mavens
// so we don't have to try to replace the format of the file on the fly
// TODO: Fix the regular expression replacement
doLast {
ant.replaceregexp(file: outputFile, match: "org.apache.hadoop[^:]*:[^:]*", replace: "\0:jar", flags: "g")
// Filter out lines which don't have any dependencies by looking for lines with "--- "
ant.replaceregexp(file: outputFile, match: "^((?!--- ).)*\$", replace: "", byline: true)
// Remove empty lines
ant.replaceregexp(file: outputFile, match: "\\n\\n", replace: "", flags: "gm")
// Replace strings with ":a.b.c -> x.y.z" to just be ":x.y.z" getting the used version of the dependency.
ant.replaceregexp(file: outputFile, match: ":([^:]*) -> (.*)", replace: ":\\2", byline: true)
// Remove a trailing " (*)" off the end to so there is nothing after the version identifier.
ant.replaceregexp(file: outputFile, match: " \\(\\*\\)", replace: "", byline: true)
// Add ":jar" to the maven dependency string assuming that all resource types are jars.
ant.replaceregexp(file: outputFile, match: "[^:]*:[^:]*", replace: "\\0:jar", byline: true)
}
}
compileJava.dependsOn buildDependencyTree
......
......@@ -177,9 +177,21 @@ public class ApexYarnLauncher {
List<String> excludes = new ArrayList<>();
int excludeLevel = Integer.MAX_VALUE;
while ((line = br.readLine()) != null) {
int startIndex = line.indexOf("org.apache.hadoop");
if (startIndex != -1) {
excludes.add(line.substring(startIndex));
for (int i = 0; i < line.length(); i++) {
char c = line.charAt(i);
if (Character.isLetter(c)) {
if (i > excludeLevel) {
excludes.add(line.substring(i));
} else {
if (line.substring(i).startsWith("org.apache.hadoop")) {
excludeLevel = i;
excludes.add(line.substring(i));
} else {
excludeLevel = Integer.MAX_VALUE;
}
}
break;
}
}
}
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册