Skip to content

Commit

Permalink
Merge pull request #33586 from aloubyansky/output-dit-for-test-jars
Browse files Browse the repository at this point in the history
  • Loading branch information
aloubyansky authored May 25, 2023
2 parents bf19463 + 47fa50f commit b0708bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public CurationResult resolveAppModel() throws BootstrapException {
if (serializedModel != null) {
final Path p = Paths.get(serializedModel);
if (Files.exists(p)) {
try (InputStream existing = Files.newInputStream(Paths.get(serializedModel))) {
try (InputStream existing = Files.newInputStream(p)) {
final ApplicationModel appModel = (ApplicationModel) new ObjectInputStream(existing).readObject();
return new CurationResult(appModel);
} catch (IOException | ClassNotFoundException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,10 @@ private static Path toPath(URL resource) {
* @return project build dir
*/
public static Path getProjectBuildDir(Path projectRoot, Path testClassLocation) {
Path outputDir;
try {
// this should work for both maven and gradle
outputDir = projectRoot.resolve(projectRoot.relativize(testClassLocation).getName(0));
} catch (Exception e) {
// this shouldn't happen since testClassLocation is usually found under the project dir
outputDir = projectRoot;
if (!testClassLocation.startsWith(projectRoot)) {
// this typically happens in the platform testsuite where test classes are loaded from jars
return projectRoot.resolve("target");
}
return outputDir;
return projectRoot.resolve(projectRoot.relativize(testClassLocation).getName(0));
}
}

0 comments on commit b0708bc

Please sign in to comment.