Skip to content

Commit 6077e38

Browse files
committed
Add gradle task to ensure consistent location for commons-math
1 parent 6bb405b commit 6077e38

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

SequenceAnalysis/build.gradle

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,21 @@ if (project.findProject(BuildUtils.getTestProjectPath(project.gradle)) != null &
6767
dependsOn(createPipelineConfigTask)
6868
}
6969
}
70+
71+
project.task("copyJars",
72+
type: Copy,
73+
group: "Build",
74+
description: "Copy JARs to external directory",
75+
{ CopySpec copy ->
76+
copy.setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
77+
copy.from(project.configurations.external)
78+
copy.into new File("${project.labkey.explodedModuleLibDir}")
79+
copy.include {
80+
"**commons-math3-**.jar"
81+
}
82+
}
83+
).doFirst({
84+
85+
})
86+
87+
project.tasks.processModuleResources.dependsOn(project.tasks.copyJars)

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/util/FastqcRunner.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,6 @@ private List<String> getBaseParams() throws FileNotFoundException
353353
}
354354

355355
File libDir = new File(ModuleLoader.getInstance().getModule(SequenceAnalysisModule.NAME).getExplodedPath(), "lib");
356-
File coreLibDir = new File(ModuleLoader.getInstance().getModule("core").getExplodedPath(), "lib");
357-
if (!coreLibDir.exists())
358-
{
359-
throw new RuntimeException("Not found: " + coreLibDir.getPath());
360-
}
361356

362357
File fastqcDir = new File(libDir.getParentFile(), "external/fastqc");
363358
File bzJar = new File(libDir, "bzip2-0.9.1.jar");
@@ -368,12 +363,10 @@ private List<String> getBaseParams() throws FileNotFoundException
368363
if (!samJar.exists())
369364
throw new RuntimeException("Not found: " + samJar.getPath());
370365

371-
File commonsMath = new File(coreLibDir, "commons-math3-3.6.1.jar");
366+
File commonsMath = new File(libDir, "commons-math3-3.6.1.jar");
372367
if (!commonsMath.exists())
373368
{
374-
File[] files = coreLibDir.listFiles();
375-
String contents = files == null ? "null" : Arrays.stream(files).map(File::getName).filter(x -> x.contains("jar")).collect(Collectors.joining(","));
376-
throw new RuntimeException("Not found: " + commonsMath.getPath() + ", files present: " + contents);
369+
throw new RuntimeException("Not found: " + commonsMath.getPath());
377370
}
378371

379372
List<String> classPath = new ArrayList<>();

0 commit comments

Comments
 (0)