mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
Adds initial interface for platform resource generation
This commit is contained in:
parent
2e5cdc109b
commit
43aebc4174
1
pom.xml
1
pom.xml
|
@ -76,6 +76,7 @@
|
|||
<module>teavm-dom</module>
|
||||
<module>teavm-jso</module>
|
||||
<module>teavm-html4j</module>
|
||||
<module>teavm-platform</module>
|
||||
</modules>
|
||||
|
||||
<dependencyManagement>
|
||||
|
|
4
teavm-platform/.gitignore
vendored
Normal file
4
teavm-platform/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
/target
|
||||
/.settings
|
||||
/.project
|
||||
/.classpath
|
19
teavm-platform/pom.xml
Normal file
19
teavm-platform/pom.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.teavm</groupId>
|
||||
<artifactId>teavm</artifactId>
|
||||
<version>0.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>teavm-platform</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.teavm</groupId>
|
||||
<artifactId>teavm-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,11 @@
|
|||
package org.teavm.platform.metadata;
|
||||
|
||||
import org.teavm.model.MethodReference;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
||||
*/
|
||||
public interface MetadataGenerator {
|
||||
Object generateMetadata(MetadataGeneratorContext context, MethodReference method);
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package org.teavm.platform.metadata;
|
||||
|
||||
import org.teavm.model.ListableClassReaderSource;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
||||
*/
|
||||
public interface MetadataGeneratorContext {
|
||||
ListableClassReaderSource getClassSource();
|
||||
|
||||
<T> T createResource(Class<T> resourceType);
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package org.teavm.platform.metadata;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface MetadataProvider {
|
||||
Class<? extends MetadataGenerator> value();
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package org.teavm.platform.metadata;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
public @interface Resource {
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package org.teavm.platform.metadata;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
||||
*/
|
||||
public interface ResourceArray<T> {
|
||||
int size();
|
||||
|
||||
T get(int i);
|
||||
|
||||
void add(T elem);
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package org.teavm.platform.metadata;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
||||
*/
|
||||
public interface ResourceMap<T> {
|
||||
T get(String key);
|
||||
|
||||
void put(String key, T value);
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package org.teavm.platform.plugin;
|
||||
|
||||
import org.teavm.vm.spi.TeaVMHost;
|
||||
import org.teavm.vm.spi.TeaVMPlugin;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Alexey Andreev <konsoletyper@gmail.com>
|
||||
*/
|
||||
public class PlatformPlugin implements TeaVMPlugin {
|
||||
@Override
|
||||
public void install(TeaVMHost host) {
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
org.teavm.platform.plugin.PlatformPlugin
|
Loading…
Reference in New Issue
Block a user