JME Project in Scala, How to get the Assets Folder?

Hi, I’m trying to set up a small jME3 Project with the SDK.

My Classes are in Scala, so I started a Scala Project to have all the compiler settings right.

I just don’t know how I can get the nice Project Assets Folder that is automatically generated when I start a new JME Project.

Is there any configuration File I have to edit to get this Folder?



Will I generally run into configuration Problems building the whole thing without having started a JME project?



Thnaks

Dan

The issue is that if you create the asset folder manually then you won’t be able to access many of jMP’s features.

I’m currently using a the dirty manually created folder solution for my projects. The only issue though is that files in that folder doesn’t have a correct right click menu and don’t open in scene editor, … So I created a dummy project to manage my assets and a symbolic link. I will look at what I did if needed, I doesn’t remember exactly what files where edited.

I’ve created another project, this time using git. So here is a diff of the files located in “nbproject”.



[patch]

diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml

index 63c2c3a…bc5241b 100644

— a/nbproject/build-impl.xml

+++ b/nbproject/build-impl.xml

@@ -21,6 +21,7 @@ is divided into following sections:



–>

<project xmlns:jaxrpc=“http://www.netbeans.org/ns/scala-project/jax-rpc” xmlns:scalaProject1=“http://www.netbeans.org/ns/scala-project/1” basedir="…" default=“default” name=“SwingNodes-impl”>

  • <import file="assets-impl.xml"/>

    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>

    <!–

    ======================

    @@ -144,6 +145,7 @@ is divided into following sections:

    <!-- You can override this target in the …/build.xml file. -->

    </target>

    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
  •    &lt;fail unless=&quot;src.assets2.dir&quot;&gt;Must set src.assets2.dir&lt;/fail&gt;<br />
    

<fail unless="src.dir">Must set src.dir</fail>

<fail unless="test.src.dir">Must set test.src.dir</fail>

<fail unless="build.dir">Must set build.dir</fail>

@@ -403,6 +405,7 @@ is divided into following sections:

<scalaProject1:scalac/>

<scalaProject1:javac/>

<copy todir="${build.classes.dir}">

  •        &lt;fileset dir=&quot;${src.assets2.dir}&quot; excludes=&quot;${build.classes.excludes},${excludes}&amp;#10;                        &quot; includes=&quot;${includes}&quot;/&gt;<br />
    

<fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}&#10; " includes="${includes}"/>

</copy>

</target>

diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties

index 4998439…eb7cbe0 100644

— a/nbproject/project.properties

+++ b/nbproject/project.properties

@@ -64,5 +64,8 @@ scalac.compilerargs=

scalac.deprecation=no

scalac.unchecked=no

source.encoding=UTF-8

+src.assets2.dir=assets

src.dir=src

test.src.dir=test

+src.assets.dir=assets

+assets.folder.name=assets

No newline at end of file

diff --git a/nbproject/project.xml b/nbproject/project.xml

index ad4b41a…c29431a 100644

— a/nbproject/project.xml

+++ b/nbproject/project.xml

@@ -6,6 +6,7 @@

<name>SwingNodes</name>

<minimum-ant-version>1.6.5</minimum-ant-version>

<source-roots>

  •            &lt;root id=&quot;src.assets2.dir&quot;/&gt;<br />
    

<root id="src.dir"/>

</source-roots>

<test-roots>

[/patch]





And you will need to create this file in nbproject folder:

assets-impl.xml

[xml]

<?xml version="1.0" encoding="UTF-8"?>

<!–assets-impl.xml v1.0–>

<project name="assets-impl" basedir="…">

<target name="-init-assets">

<jar jarfile="${build.dir}/${assets.jar.name}" excludes="${assets.excludes}" basedir="${assets.folder.name}" compress="${assets.compress}"/>

<property location="${assets.folder.name}" name="assets.dir.resolved"/>

<property location="${build.dir}/${assets.jar.name}" name="assets.jar.resolved"/>

<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>

<pathconvert property="run.classpath.without.build.classes.dir">

<path path="${run.classpath}"/>

<map from="${build.classes.dir.resolved}" to=""/>

<map from="${assets.dir.resolved}" to="${assets.jar.resolved}"/>

</pathconvert>

</target>

</project>

[/xml]

You can edit any projects assets by using “File->Import->External Project Assets” but only the default java/ant “BasicGame” project will give you all deployment etc. options. To keep this functionality I suggest creating a normal BasicGame project for your game and then creating a Scala project for the central classes, importing that to the BasicGame project and starting the scala-based “kernel” from there.

How can you import a Scala project into the BasicGame ?

You create a jar from it and include it to the project class path.