Page 1 of 1
Cmake, AI, java with dependencier on Wrappers/JavaOO
Posted: 10 Jun 2015, 01:13
by bioinfornatics
Dear,
I seen a really cool cmake macro named ConfigureJavaSkirmishAI
That ease the build script but unfortunately that do not put Wrappers/JavaOO as dependencies
If i do
Code: Select all
set(additionalLibraries ${JavaOO_AIWRAPPER_TARGET} )
ConfigureJavaSkirmishAI("")
I have some errors as:
Code: Select all
error: cannot find symbol
private final AIFloat3 pos;
This symbol is define by spring/AI/Wrappers/JavaOO/src/main/java/com/springrts/ai/oo/AIFloat3.java
What should I to do to fix it?
Re: Cmake, AI, java with dependencier on Wrappers/JavaOO
Posted: 10 Jun 2015, 01:32
by bioinfornatics
Sorry I found myself by using
Code: Select all
ConfigureJavaSkirmishAI( "JavaOO" )
Re: Cmake, AI, java with dependencier on Wrappers/JavaOO
Posted: 11 Jun 2015, 02:26
by bioinfornatics
Finally not
Source code is at : spring/AI/Skirmish/DAI/
In the CMakeLists.txt
Code: Select all
ConfigureMavenJavaSkirmishAI( "JavaOO" )
the pom.xml at end of this thread
When I run make , build system fail to find symbol from JavaOO wrapper
I get many symbol not found:
Code: Select all
cannot find symbol
[ERROR] symbol: class Unit
[ERROR] location: class com.springrts.dai.DAI
so how to add this dependency ?
Code: Select all
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.springrts</groupId>
<artifactId>springrts-dai</artifactId>
<version>0.1.0</version>
<name>DAI</name>
<description>Bot for spring rts game</description>
<repositories>
<!-- TODO remove this once maven central replicates the jboss repository -->
<!-- Included so the examples sources in the distribution zip build out-of-the-box with maven -->
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<finalName>SkirmishAI</finalName>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<droolsVersion>6.2.0.Final</droolsVersion>
</properties>
<dependencies>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<version>${droolsVersion}</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>knowledge-api</artifactId>
<version>${droolsVersion}</version>
</dependency>
</dependencies>
</project>
Thanks
Re: Cmake, AI, java with dependencier on Wrappers/JavaOO
Posted: 11 Jun 2015, 11:18
by lamer
I'm not into Java, can't help with exact issue, but here is the workflow that works for me:
$ git clone
https://github.com/spring/spring.git
$ cd spring
$ cp -r AI/Skirmish/NullOOJavaAI AI/Skirmish/MyGreenTeaAI
$ cmake . -DJAVA_HOME=/usr/lib/jvm/java-8-openjdk
$ make MyGreenTeaAI
$ (install/copy)
Or checkout how other devs did it (never tested myself)?
https://github.com/cranphin/crans-java-ai.git
https://github.com/Anarchid/zkgbai.git
https://github.com/DeinFreund/FreundAI.git
Re: Cmake, AI, java with dependencier on Wrappers/JavaOO
Posted: 12 Jun 2015, 10:15
by abma
remove/rename pom.xml from your ai source dir should fix the problems imo... this should be fixed in current development version of spring.
maybe see HughAI as example, how a Java AI is integrated to spring source code / the buildprocess:
https://github.com/spring/HughAI
or as "ideal" example:
https://github.com/spring/spring/blob/d ... eLists.txt
note: the cmake code wasn't touched for a long time, it needs a cleanup!