Skip to content

Commit

Permalink
Hacking it
Browse files Browse the repository at this point in the history
Signed-off-by: tvallin <thibault.vallin@oracle.com>
  • Loading branch information
tvallin committed Jul 12, 2023
1 parent b6cc2a4 commit f7a6dca
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,10 @@ protected String determinePackageName(Optional<ServiceProvider<ModuleComponent>>
// check for the existence of the file
packageName = loadAppPackageName().orElse(null);
if (packageName != null) {
if ("unnamed".equals(packageName)) {
getLog().debug("Errors: load from file");
if (!"unnamed".equals(packageName)) {
return packageName;
}
return packageName;
getLog().debug("Errors: load from file");
}

ServiceProvider<ModuleComponent> moduleSp = optModuleSp.orElse(null);
Expand Down Expand Up @@ -307,8 +307,9 @@ protected String determinePackageName(Optional<ServiceProvider<ModuleComponent>>
}

if (persistIt) {
getLog().debug("Errors: Saving - " + packageName);
// record it to scratch file for later consumption (during test build for example)
saveAppPackageName(packageName, getLog());
saveAppPackageName(packageName);
}

return packageName;
Expand All @@ -328,10 +329,7 @@ protected Optional<String> loadAppPackageName() {
*
* @param packageName the package name
*/
protected void saveAppPackageName(String packageName, Log logger) {
if ("unnamed".equals(packageName)) {
logger.debug("Errors: " + Arrays.toString(Thread.currentThread().getStackTrace()));
}
protected void saveAppPackageName(String packageName) {
ModuleUtils.saveAppPackageName(getPicoScratchDir().toPath(), packageName);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,7 @@ Optional<Path> codegenModuleInfoFilerOut(ModuleInfoDescriptor newDeltaDescriptor
}

if (!newDeltaDescriptor.isUnnamed()) {
String name = normalizedBaseModuleName(newDeltaDescriptor.name());
if (name.equals("unnamed")) {
messager.debug("Errors: name " + Arrays.toString(Thread.currentThread().getStackTrace()));
}
saveAppPackageName(scratchBaseOutputPath, name);
saveAppPackageName(scratchBaseOutputPath, normalizedBaseModuleName(newDeltaDescriptor.name()));
}

return filePath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,8 @@ public static void saveAppPackageName(Path scratchPath,
String packageName) {
if (packageName.equals("unnamed")) {
Log.debug("Errors: " + Arrays.toString(Thread.currentThread().getStackTrace()));

packageName = "io.helidon.pico.tests.pico";
}
File scratchDir = scratchPath.toFile();
File packageFileName = new File(scratchDir, APPLICATION_PACKAGE_FILE_NAME);
Expand Down

0 comments on commit f7a6dca

Please sign in to comment.