Compile own fake class signatures. Ensures the class files are complete and can link inside Javac.
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Wed, 30 Apr 2014 09:26:28 +0200
changeset 15125171ac3b4232
parent 1511 1200ad163e2c
child 1513 ba912ef24b27
child 1539 ae8575329e1b
Compile own fake class signatures. Ensures the class files are complete and can link inside Javac.
pom.xml
rt/emul/fake/pom.xml
rt/emul/fake/src/main/java/java/io/PrintStream.java
rt/emul/fake/src/main/java/java/io/PrintWriter.java
rt/emul/fake/src/main/java/java/net/URI.java
rt/emul/fake/src/main/java/java/net/URISyntaxException.java
rt/emul/fake/src/main/java/java/net/URLConnection.java
rt/emul/fake/src/main/java/java/util/Locale.java
rt/emul/mini/pom.xml
rt/emul/pom.xml
     1.1 --- a/pom.xml	Wed Apr 30 08:54:28 2014 +0200
     1.2 +++ b/pom.xml	Wed Apr 30 09:26:28 2014 +0200
     1.3 @@ -85,7 +85,8 @@
     1.4                    <excludes>
     1.5                         <exclude>*</exclude>
     1.6                         <exclude>.*/**</exclude>
     1.7 -                       <exclude>rt/emul/*/src/main/**</exclude>
     1.8 +                       <exclude>rt/emul/mini/src/main/**</exclude>
     1.9 +                       <exclude>rt/emul/compact/src/main/**</exclude>
    1.10                         <exclude>rt/vm/src/main/java/org/apidesign/vm4brwsr/ByteCodeParser.java</exclude>
    1.11                         <exclude>rt/archetype/src/main/resources/archetype-resources/**</exclude>
    1.12                         <exclude>rt/emul/compact/src/test/resources/**</exclude>
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/rt/emul/fake/pom.xml	Wed Apr 30 09:26:28 2014 +0200
     2.3 @@ -0,0 +1,28 @@
     2.4 +<?xml version="1.0" encoding="UTF-8"?>
     2.5 +<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">
     2.6 +    <modelVersion>4.0.0</modelVersion>
     2.7 +    <parent>
     2.8 +        <groupId>org.apidesign.bck2brwsr</groupId>
     2.9 +        <artifactId>emul.pom</artifactId>
    2.10 +        <version>0.9-SNAPSHOT</version>
    2.11 +    </parent>
    2.12 +    <artifactId>fake</artifactId>
    2.13 +    <packaging>jar</packaging>
    2.14 +    <name>Fake Stubs of Java APIs</name>
    2.15 +    <description>
    2.16 +        The minimal emulation classes have certain references
    2.17 +        to less essential classes in the JDK. This module provides
    2.18 +        their stubs for purpose of compilation.
    2.19 +    </description> 
    2.20 +    <build>
    2.21 +        <plugins>
    2.22 +            <plugin>
    2.23 +                <artifactId>maven-deploy-plugin</artifactId>
    2.24 +                <version>2.7</version>
    2.25 +                <configuration>
    2.26 +                    <skip>true</skip>
    2.27 +                </configuration>
    2.28 +            </plugin>
    2.29 +        </plugins>
    2.30 +    </build>
    2.31 +</project>
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/rt/emul/fake/src/main/java/java/io/PrintStream.java	Wed Apr 30 09:26:28 2014 +0200
     3.3 @@ -0,0 +1,26 @@
     3.4 +/**
     3.5 + * Back 2 Browser Bytecode Translator
     3.6 + * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
     3.7 + *
     3.8 + * This program is free software: you can redistribute it and/or modify
     3.9 + * it under the terms of the GNU General Public License as published by
    3.10 + * the Free Software Foundation, version 2 of the License.
    3.11 + *
    3.12 + * This program is distributed in the hope that it will be useful,
    3.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    3.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    3.15 + * GNU General Public License for more details.
    3.16 + *
    3.17 + * You should have received a copy of the GNU General Public License
    3.18 + * along with this program. Look for COPYING file in the top folder.
    3.19 + * If not, see http://opensource.org/licenses/GPL-2.0.
    3.20 + */
    3.21 +package java.io;
    3.22 +
    3.23 +/** Fake signature of an existing Java class.
    3.24 + * @author Jaroslav Tulach
    3.25 + */
    3.26 +public abstract class PrintStream {
    3.27 +    public abstract void print(String s);
    3.28 +    public abstract void println(String s);
    3.29 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/rt/emul/fake/src/main/java/java/io/PrintWriter.java	Wed Apr 30 09:26:28 2014 +0200
     4.3 @@ -0,0 +1,26 @@
     4.4 +/**
     4.5 + * Back 2 Browser Bytecode Translator
     4.6 + * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
     4.7 + *
     4.8 + * This program is free software: you can redistribute it and/or modify
     4.9 + * it under the terms of the GNU General Public License as published by
    4.10 + * the Free Software Foundation, version 2 of the License.
    4.11 + *
    4.12 + * This program is distributed in the hope that it will be useful,
    4.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    4.15 + * GNU General Public License for more details.
    4.16 + *
    4.17 + * You should have received a copy of the GNU General Public License
    4.18 + * along with this program. Look for COPYING file in the top folder.
    4.19 + * If not, see http://opensource.org/licenses/GPL-2.0.
    4.20 + */
    4.21 +package java.io;
    4.22 +
    4.23 +/** Fake signature of an existing Java class.
    4.24 + * @author Jaroslav Tulach
    4.25 + */
    4.26 +public abstract class PrintWriter {
    4.27 +    public abstract PrintWriter append(String s);
    4.28 +    public abstract void println(String s);
    4.29 +}
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/rt/emul/fake/src/main/java/java/net/URI.java	Wed Apr 30 09:26:28 2014 +0200
     5.3 @@ -0,0 +1,26 @@
     5.4 +/**
     5.5 + * Back 2 Browser Bytecode Translator
     5.6 + * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
     5.7 + *
     5.8 + * This program is free software: you can redistribute it and/or modify
     5.9 + * it under the terms of the GNU General Public License as published by
    5.10 + * the Free Software Foundation, version 2 of the License.
    5.11 + *
    5.12 + * This program is distributed in the hope that it will be useful,
    5.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    5.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    5.15 + * GNU General Public License for more details.
    5.16 + *
    5.17 + * You should have received a copy of the GNU General Public License
    5.18 + * along with this program. Look for COPYING file in the top folder.
    5.19 + * If not, see http://opensource.org/licenses/GPL-2.0.
    5.20 + */
    5.21 +package java.net;
    5.22 +
    5.23 +/** Fake signature of an existing Java class.
    5.24 + * @author Jaroslav Tulach
    5.25 + */
    5.26 +public class URI {
    5.27 +    public URI(String url) {
    5.28 +    }
    5.29 +}
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/rt/emul/fake/src/main/java/java/net/URISyntaxException.java	Wed Apr 30 09:26:28 2014 +0200
     6.3 @@ -0,0 +1,25 @@
     6.4 +/**
     6.5 + * Back 2 Browser Bytecode Translator
     6.6 + * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
     6.7 + *
     6.8 + * This program is free software: you can redistribute it and/or modify
     6.9 + * it under the terms of the GNU General Public License as published by
    6.10 + * the Free Software Foundation, version 2 of the License.
    6.11 + *
    6.12 + * This program is distributed in the hope that it will be useful,
    6.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    6.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    6.15 + * GNU General Public License for more details.
    6.16 + *
    6.17 + * You should have received a copy of the GNU General Public License
    6.18 + * along with this program. Look for COPYING file in the top folder.
    6.19 + * If not, see http://opensource.org/licenses/GPL-2.0.
    6.20 + */
    6.21 +package java.net;
    6.22 +
    6.23 +/** Fake signature of an existing Java class.
    6.24 + * @author Jaroslav Tulach
    6.25 + */
    6.26 +public class URISyntaxException extends Exception {
    6.27 +    
    6.28 +}
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/rt/emul/fake/src/main/java/java/net/URLConnection.java	Wed Apr 30 09:26:28 2014 +0200
     7.3 @@ -0,0 +1,33 @@
     7.4 +/**
     7.5 + * Back 2 Browser Bytecode Translator
     7.6 + * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
     7.7 + *
     7.8 + * This program is free software: you can redistribute it and/or modify
     7.9 + * it under the terms of the GNU General Public License as published by
    7.10 + * the Free Software Foundation, version 2 of the License.
    7.11 + *
    7.12 + * This program is distributed in the hope that it will be useful,
    7.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    7.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    7.15 + * GNU General Public License for more details.
    7.16 + *
    7.17 + * You should have received a copy of the GNU General Public License
    7.18 + * along with this program. Look for COPYING file in the top folder.
    7.19 + * If not, see http://opensource.org/licenses/GPL-2.0.
    7.20 + */
    7.21 +package java.net;
    7.22 +
    7.23 +import java.io.IOException;
    7.24 +import java.io.InputStream;
    7.25 +
    7.26 +/** Fake signature of an existing Java class.
    7.27 + * @author Jaroslav Tulach
    7.28 + */
    7.29 +public abstract class URLConnection {
    7.30 +    protected URL url;
    7.31 +    public URLConnection(URL u) {
    7.32 +    }
    7.33 +    public abstract void connect() throws IOException;
    7.34 +    public abstract InputStream getInputStream() throws IOException;
    7.35 +    
    7.36 +}
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/rt/emul/fake/src/main/java/java/util/Locale.java	Wed Apr 30 09:26:28 2014 +0200
     8.3 @@ -0,0 +1,24 @@
     8.4 +/**
     8.5 + * Back 2 Browser Bytecode Translator
     8.6 + * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
     8.7 + *
     8.8 + * This program is free software: you can redistribute it and/or modify
     8.9 + * it under the terms of the GNU General Public License as published by
    8.10 + * the Free Software Foundation, version 2 of the License.
    8.11 + *
    8.12 + * This program is distributed in the hope that it will be useful,
    8.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    8.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    8.15 + * GNU General Public License for more details.
    8.16 + *
    8.17 + * You should have received a copy of the GNU General Public License
    8.18 + * along with this program. Look for COPYING file in the top folder.
    8.19 + * If not, see http://opensource.org/licenses/GPL-2.0.
    8.20 + */
    8.21 +package java.util;
    8.22 +
    8.23 +/** Fake signature of an existing Java class.
    8.24 + * @author Jaroslav Tulach
    8.25 + */
    8.26 +public abstract class Locale {
    8.27 +}
     9.1 --- a/rt/emul/mini/pom.xml	Wed Apr 30 08:54:28 2014 +0200
     9.2 +++ b/rt/emul/mini/pom.xml	Wed Apr 30 09:26:28 2014 +0200
     9.3 @@ -22,58 +22,27 @@
     9.4        <type>jar</type>
     9.5      </dependency>
     9.6      <dependency>
     9.7 +      <groupId>org.apidesign.bck2brwsr</groupId>
     9.8 +      <artifactId>fake</artifactId>
     9.9 +      <version>0.9-SNAPSHOT</version>
    9.10 +      <scope>provided</scope>
    9.11 +      <type>jar</type>
    9.12 +    </dependency>
    9.13 +    <dependency>
    9.14        <groupId>org.testng</groupId>
    9.15        <artifactId>testng</artifactId>
    9.16 -      <version>6.5.2</version>
    9.17        <scope>test</scope>
    9.18      </dependency>
    9.19    </dependencies>
    9.20    <build>
    9.21        <plugins>
    9.22            <plugin>
    9.23 -              <artifactId>maven-antrun-plugin</artifactId>
    9.24 -              <version>1.7</version>
    9.25 -              <executions>
    9.26 -                  <execution>
    9.27 -                      <phase>generate-sources</phase>
    9.28 -                      <configuration>
    9.29 -                          <target>
    9.30 -                              <mkdir dir="${project.build.directory}/bootcp" />
    9.31 -                              <copy todir="${project.build.directory}/bootcp">
    9.32 -                                  <resources>
    9.33 -                                      <!-- copy all resources that are in
    9.34 -                                        compact profile, but are referenced from
    9.35 -                                        the mini profile
    9.36 -                                      -->
    9.37 -                                      <javaresource name="java/net/URI.class" />
    9.38 -                                      <javaresource name="java/net/URISyntaxException.class" />
    9.39 -                                      <javaresource name="java/net/URLConnection.class" />
    9.40 -                                      <javaresource name="java/util/Locale.class" />
    9.41 -                                      <javaresource name="java/io/OutputStream.class" />
    9.42 -                                      <javaresource name="java/io/FilterOutputStream.class" />
    9.43 -                                      <javaresource name="java/io/PrintStream.class" />
    9.44 -                                      <javaresource name="java/io/PrintWriter.class" />
    9.45 -                                      <javaresource name="java/io/Writer.class" />
    9.46 -                                  </resources>
    9.47 -                              </copy>
    9.48 -                          </target>
    9.49 -                      </configuration>
    9.50 -                      <goals>
    9.51 -                          <goal>run</goal>
    9.52 -                      </goals>
    9.53 -                  </execution>
    9.54 -              </executions>
    9.55 -          </plugin>
    9.56 -          <plugin>
    9.57                <groupId>org.apache.maven.plugins</groupId>
    9.58                <artifactId>maven-compiler-plugin</artifactId>
    9.59                <version>2.5.1</version>
    9.60                <configuration>
    9.61                    <compilerArguments>
    9.62 -                      <!--
    9.63 -                        <bootclasspath>netbeans.ignore.jdk.bootsclasspath</bootclasspath>
    9.64 -                      -->
    9.65 -                      <bootclasspath>${project.build.directory}/bootcp/</bootclasspath>
    9.66 +                      <bootclasspath>netbeans.ignore.jdk.bootsclasspath</bootclasspath>
    9.67                    </compilerArguments>
    9.68                   <source>1.7</source>
    9.69                   <target>1.7</target>
    10.1 --- a/rt/emul/pom.xml	Wed Apr 30 08:54:28 2014 +0200
    10.2 +++ b/rt/emul/pom.xml	Wed Apr 30 09:26:28 2014 +0200
    10.3 @@ -15,5 +15,6 @@
    10.4      <module>mini</module>
    10.5      <module>compact</module>
    10.6      <module>brwsrtest</module>
    10.7 +    <module>fake</module>
    10.8    </modules>
    10.9  </project>