Cmake, AI, java with dependencier on Wrappers/JavaOO

Cmake, AI, java with dependencier on Wrappers/JavaOO

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
bioinfornatics
Posts: 13
Joined: 11 Oct 2014, 13:13

Cmake, AI, java with dependencier on Wrappers/JavaOO

Post 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?
bioinfornatics
Posts: 13
Joined: 11 Oct 2014, 13:13

Re: Cmake, AI, java with dependencier on Wrappers/JavaOO

Post by bioinfornatics »

Sorry I found myself by using

Code: Select all

ConfigureJavaSkirmishAI( "JavaOO" )
bioinfornatics
Posts: 13
Joined: 11 Oct 2014, 13:13

Re: Cmake, AI, java with dependencier on Wrappers/JavaOO

Post 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
lamer
Posts: 153
Joined: 08 Mar 2014, 23:13

Re: Cmake, AI, java with dependencier on Wrappers/JavaOO

Post 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
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Cmake, AI, java with dependencier on Wrappers/JavaOO

Post 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!
Post Reply

Return to “AI”