8174739: Rename JMOD section name for native libraries from native to lib

Reviewed-by: alanb
This commit is contained in:
Mandy Chung 2017-02-10 10:26:46 -08:00
parent e057678bf7
commit 62274dc8df
8 changed files with 17 additions and 17 deletions

View File

@ -78,7 +78,7 @@ public class JmodFile implements AutoCloseable {
HEADER_FILES("include"),
LEGAL_NOTICES("legal"),
MAN_PAGES("man"),
NATIVE_LIBS("native"),
NATIVE_LIBS("lib"),
NATIVE_CMDS("bin");
private final String jmodDir;

View File

@ -362,7 +362,7 @@ public final class DefaultImageBuilder implements ImageBuilder {
String module = "/" + entry.moduleName() + "/";
String filename = entry.path().substring(module.length());
// Remove radical native|config|...
// Remove radical lib|config|...
return filename.substring(filename.indexOf('/') + 1);
}

View File

@ -38,7 +38,7 @@ import jdk.tools.jlink.plugin.ResourcePoolEntry;
* <li>For jimage content: /{module name}/{package1}/.../{packageN}/{file
* name}</li>
* <li>For other files (shared lib, launchers, config, ...):/{module name}/
* {@literal bin|conf|native}/{dir1}>/.../{dirN}/{file name}</li>
* {@literal bin|conf|lib}/{dir1}>/.../{dirN}/{file name}</li>
* </ul>
*/
abstract class AbstractResourcePoolEntry implements ResourcePoolEntry {

View File

@ -95,9 +95,9 @@ public final class ExcludeVMPlugin implements Plugin {
/**
* VM paths:
* /java.base/native/{architecture}/{server|client|minimal}/{shared lib}
* e.g.: /java.base/native/amd64/server/libjvm.so
* /java.base/native/server/libjvm.dylib
* /java.base/lib/{architecture}/{server|client|minimal}/{shared lib}
* e.g.: /java.base/lib/server/libjvm.so
* /java.base/lib/server/libjvm.dylib
*/
private List<ResourcePoolEntry> getVMs(ResourcePoolModule javaBase, String[] jvmlibs) {
List<ResourcePoolEntry> ret = javaBase.entries().filter((t) -> {
@ -198,17 +198,17 @@ public final class ExcludeVMPlugin implements Plugin {
}
case CLIENT: {
target = Jvm.CLIENT;
exclude = "/java.base/native**server/**,/java.base/native**minimal/**";
exclude = "/java.base/lib**server/**,/java.base/lib**minimal/**";
break;
}
case SERVER: {
target = Jvm.SERVER;
exclude = "/java.base/native**client/**,/java.base/native**minimal/**";
exclude = "/java.base/lib**client/**,/java.base/lib**minimal/**";
break;
}
case MINIMAL: {
target = Jvm.MINIMAL;
exclude = "/java.base/native**server/**,/java.base/native**client/**";
exclude = "/java.base/lib**server/**,/java.base/lib**client/**";
break;
}
default: {

View File

@ -62,7 +62,7 @@ are different.
exclude-files.argument=<pattern-list> of files to exclude
exclude-files.description=\
Specify files to exclude. e.g.: **.java,glob:/java.base/native/client/**
Specify files to exclude. e.g.: **.java,glob:/java.base/lib/client/**
exclude-resources.argument=<pattern-list> resources to exclude

View File

@ -250,7 +250,7 @@ public class JLinkNegativeTest {
String moduleName = "hacked4";
Path jmod = helper.generateDefaultJModule(moduleName).assertSuccess();
JImageGenerator.addFiles(jmod,
new InMemoryFile("/native", new byte[0]),
new InMemoryFile("/lib", new byte[0]),
new InMemoryFile("/conf", new byte[0]),
new InMemoryFile("/bin", new byte[0]));
try {

View File

@ -155,10 +155,10 @@ public class ExcludeVMPluginTest {
String[] winput = new String[input.length];
String[] woutput = new String[expectedOutput.length];
for (int i = 0; i < input.length; i++) {
winput[i] = "/java.base/native" + arch + input[i];
winput[i] = "/java.base/lib" + arch + input[i];
}
for (int i = 0; i < expectedOutput.length; i++) {
woutput[i] = "/java.base/native" + arch + expectedOutput[i];
woutput[i] = "/java.base/lib" + arch + expectedOutput[i];
}
doCheckVM(vm, winput, jvmcfg, woutput, expectdJvmCfg);
}
@ -169,7 +169,7 @@ public class ExcludeVMPluginTest {
byte[] jvmcfgContent = jvmcfg.getBytes();
ResourcePoolManager poolMgr = new ResourcePoolManager();
poolMgr.add(
ResourcePoolEntry.create("/java.base/native/jvm.cfg",
ResourcePoolEntry.create("/java.base/lib/jvm.cfg",
ResourcePoolEntry.Type.NATIVE_LIB, jvmcfgContent));
// java.base/module-info.class is used by exclude vm plugin
@ -192,7 +192,7 @@ public class ExcludeVMPluginTest {
p.configure(config);
ResourcePool out = p.transform(poolMgr.resourcePool(), outMgr.resourcePoolBuilder());
String newContent = new String(out.findEntry("/java.base/native/jvm.cfg").get().contentBytes());
String newContent = new String(out.findEntry("/java.base/lib/jvm.cfg").get().contentBytes());
if (!expectdJvmCfg.equals(newContent)) {
throw new Exception("Got content " + newContent + " expected " + expectdJvmCfg);
@ -209,7 +209,7 @@ public class ExcludeVMPluginTest {
}
out.entries().forEach(md -> {
if (md.path().equals("/java.base/native/jvm.cfg") ||
if (md.path().equals("/java.base/lib/jvm.cfg") ||
md.path().equals("/java.base/module-info.class")) {
return;
}

View File

@ -66,7 +66,7 @@ public class JmodTest {
static final String CLASSES_PREFIX = "classes/";
static final String CMDS_PREFIX = "bin/";
static final String LIBS_PREFIX = "native/";
static final String LIBS_PREFIX = "lib/";
static final String CONFIGS_PREFIX = "conf/";
@BeforeTest