Skip to content
Snippets Groups Projects
Commit cc2b04ce authored by Romain Gilles's avatar Romain Gilles
Browse files

Revert "Create a maven like project structure for java development. Make it...

Revert "Create a maven like project structure for java development. Make it OSGi compliant. Generate the flatbuffers code for testing (example)."

This reverts commit 9875b0e0.
parent 9875b0e0
No related branches found
No related tags found
No related merge requests found
......@@ -54,8 +54,8 @@ build/Xcode/FlatBuffers.xcodeproj/project.xcworkspace/**
build/Xcode/FlatBuffers.xcodeproj/xcuserdata/**
FlatBuffers.xcodeproj/
java/.idea
*.iml
target
java/*.iml
java/target
**/*.pyc
.idea
build/VS2010/FlatBuffers.sdf
......
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<parent>
<groupId>com.google.flatbuffers</groupId>
<artifactId>flatbuffers</artifactId>
<version>1.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>flatbuffers-java</artifactId>
<packaging>bundle</packaging>
<name>FlatBuffers Java API</name>
<description>
Memory Efficient Serialization Library
</description>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<flatbuffers.root.dir>${basedir}/../..</flatbuffers.root.dir>
<generated.test.sources.directory>${project.build.directory}/generated-test-sources/flatbuffers
</generated.test.sources.directory>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-test-sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${flatbuffers.root.dir}/flatc</executable>
<arguments>
<argument>--java</argument>
<argument>-o</argument>
<argument>${generated.test.sources.directory}</argument>
<argument>${basedir}/src/test/fbs/test.fbs</argument>
</arguments>
<testSourceRoot>${generated.test.sources.directory}</testSourceRoot>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
namespace com.google.flatbuffer.test;
table MyTable
{
foo:int;
}
enum MyEnum:byte
{
A, B, C
}
struct MyStruct
{
a:int;
b:int;
}
root_type MyTable;
\ No newline at end of file
package com.google.flatbuffers.test;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.Test;
import com.google.flatbuffer.test.MyTable;
import com.google.flatbuffers.FlatBufferBuilder;
/**
* Dummy Test to demo JUnit usage.
*/
public class DummyTest {
@Test
public void testDummy() {
FlatBufferBuilder builder = new FlatBufferBuilder();
int tableOffSet = MyTable.createMyTable(builder, 42);
MyTable.finishMyTableBuffer(builder, tableOffSet);
MyTable myTable = MyTable.getRootAsMyTable(builder.dataBuffer());
assertThat(myTable.foo(), is(42));
}
}
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<parent>
<groupId>com.google.flatbuffers</groupId>
<artifactId>flatbuffers</artifactId>
<version>1.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>flatbuffers-jmh</artifactId>
<packaging>jar</packaging>
<name>FlatBuffers JMH micro-benchmark</name>
<description>
Micro benchmark to help in technical design decisions.
</description>
<properties>
<jmh.version>1.12</jmh.version>
<uberjar.name>benchmarks</uberjar.name>
</properties>
<dependencies>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>${jmh.version}</version>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>${jmh.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>${uberjar.name}</finalName>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.openjdk.jmh.Main</mainClass>
</transformer>
</transformers>
<filters>
<filter>
<!--
Shading signed JARs will fail without this.
http://stackoverflow.com/questions/999489/invalid-signature-file-when-attempting-to-run-a-jar
-->
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.flatbuffers</groupId>
<artifactId>flatbuffers</artifactId>
<artifactId>flatbuffers-java</artifactId>
<version>1.3.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>FlatBuffers</name>
<packaging>jar</packaging>
<name>FlatBuffers Java API</name>
<description>
Memory Efficient Serialization Library
</description>
......@@ -30,47 +30,10 @@
scm:git:https://github.com/google/flatbuffers.git
</connection>
</scm>
<prerequisites>
<maven>3.0</maven>
</prerequisites>
<modules>
<module>flatbuffers</module>
<module>jmh</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.0.1</version>
</plugin>
</plugins>
</pluginManagement>
<sourceDirectory>./</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment