Exclude all classes from underlying JDK

This commit is contained in:
Alexey Andreev 2020-05-14 16:59:21 +03:00
parent 6a4da94f2e
commit 862e9b846f
2 changed files with 12 additions and 8 deletions

View File

@ -11,5 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
includePackageHierarchy|java=false
stripPrefixFromPackageHierarchyClasses|org.teavm.classlib.java=T
mapPackageHierarchy|org.teavm.classlib.java=java

View File

@ -127,8 +127,10 @@ public class ClasspathResourceMapper implements Function<String, ClassHolder>, C
}
}
if (cls == null) {
if (!classExclusions.apply(name)) {
cls = innerMapper.apply(name);
}
}
if (cls != null && !elementFilters.isEmpty()) {
for (ElementFilter filter : elementFilters) {
if (!filter.acceptClass(name)) {
@ -212,40 +214,41 @@ public class ClasspathResourceMapper implements Function<String, ClassHolder>, C
case STRIP_PREFIX_FROM_PACKAGE_HIERARCHY_PREFIX:
prefixMapping.setPackageHierarchyClassPrefixRule(instruction[1].split("\\."),
properties.getProperty(propertyName));
continue;
break;
case STRIP_PREFIX_FROM_PACKAGE_PREFIX:
prefixMapping.setPackageClassPrefixRule(instruction[1].split("\\."),
properties.getProperty(propertyName));
continue;
break;
case MAP_PACKAGE_HIERARCHY_PREFIX:
packageMappings.addPackageHierarchyMappingRule(properties.getProperty(propertyName).split("\\."),
instruction[1]);
reversePackageMappings.addPackageHierarchyMappingRule(instruction[1].split("\\."),
properties.getProperty(propertyName));
continue;
break;
case MAP_PACKAGE_PREFIX:
packageMappings
.addPackageMappingRule(properties.getProperty(propertyName).split("\\."), instruction[1]);
reversePackageMappings
.addPackageMappingRule(instruction[1].split("\\."), properties.getProperty(propertyName));
continue;
break;
case MAP_CLASS_PREFIX:
classMappings
.addClassMappingRule(properties.getProperty(propertyName).split("\\."), instruction[1]);
reverseClassMappings
.addClassMappingRule(instruction[1].split("\\."), properties.getProperty(propertyName));
continue;
break;
case INCLUDE_PACKAGE_HIERARCHY_PREFIX:
classExclusions.setPackageHierarchyExclusion(instruction[1].split("\\."),
!Boolean.parseBoolean(properties.getProperty(propertyName)));
continue;
break;
case INCLUDE_PACKAGE_PREFIX:
classExclusions.setPackageExclusion(instruction[1].split("\\."),
!Boolean.parseBoolean(properties.getProperty(propertyName)));
continue;
break;
case INCLUDE_CLASS_PREFIX:
classExclusions.setClassExclusion(instruction[1].split("\\."),
!Boolean.parseBoolean(properties.getProperty(propertyName)));
break;
}
}
}