Class TypedMaterialsExtension

java.lang.Object
com.onemillionworlds.configuration.TypedMaterialsExtension

public class TypedMaterialsExtension extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    TypedMaterialsExtension(org.gradle.api.Project project)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    assetsConstant(String fullyQualifiedAssetsClass)
    Registers a task to search for assets in the resources directory(s) of the project and create constants for each one.
    void
    Registers a task to search for assets in the resources directory(s) of the project and create a flat file for each one.
    org.gradle.api.file.DirectoryProperty
    The directory under which generated resources are placed.
    org.gradle.api.file.DirectoryProperty
    The directory under which generated sources are placed.
    org.gradle.api.provider.Property<String>
     
    void
    jarAssetsFile(String jarFilterRegex)
    Registers a task to search for assets in the resources directory(s) of a jar and create a flat file containing the asset locations.
    void
    jarAssetsFile(String jarFilterRegex, String fileRegex)
    Registers a task to search for assets in the resources directory(s) of a jar and create a flat file containing the asset locations.
    void
     
    void
    librarySearch(String taskName, String jarFilterRegex, String outputPackage)
    Registers a task to search for materials in the jars of the project's runtime classpath
    void
    Registers a task to search for materials in the standard location of your local project.
    void
    localMaterialsSearch(String outputPackage, String materialsDirectory, String resourcesDirName)
    Registers a task to search for materials in the given directory of your local project.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TypedMaterialsExtension

      public TypedMaterialsExtension(org.gradle.api.Project project)
  • Method Details

    • jmeMaterials

      public void jmeMaterials()
    • assetsConstant

      public void assetsConstant(String fullyQualifiedAssetsClass)
      Registers a task to search for assets in the resources directory(s) of the project and create constants for each one.

      Note that if you have resources generated by another task you may need to make the task assetConstants dependant upon your task that generates the resources.

      Parameters:
      fullyQualifiedAssetsClass - the fully qualified name of the class will be generated to contains the asset paths. E.g. "com.mygame.assets.Assets"
    • assetsFile

      public void assetsFile()
      Registers a task to search for assets in the resources directory(s) of the project and create a flat file for each one.

      This file is created in the resources root and is named com.onemillionworlds.typedmaterials.assets.txt. This enforced naming is to allow the jarAssetConstant task to find the file later.

      Note that if you have resources generated by another task you may need to make the task assetConstants dependant upon your task that generates the resources.

    • jarAssetsFile

      public void jarAssetsFile(String jarFilterRegex)
      Registers a task to search for assets in the resources directory(s) of a jar and create a flat file containing the asset locations.

      It will also include any local assets

      This file is created in the resources root and is named com.onemillionworlds.typedmaterials.assets.txt. This enforced naming is to allow the jarAssetConstant task to find the file later.

    • jarAssetsFile

      public void jarAssetsFile(String jarFilterRegex, String fileRegex)
      Registers a task to search for assets in the resources directory(s) of a jar and create a flat file containing the asset locations.

      It will also include any local assets

      This file is created in the resources root and is named com.onemillionworlds.typedmaterials.assets.txt. This enforced naming is to allow the jarAssetConstant task to find the file later.

    • librarySearch

      public void librarySearch(String taskName, String jarFilterRegex, String outputPackage)
      Registers a task to search for materials in the jars of the project's runtime classpath
      Parameters:
      taskName - just a name for the task, needs to be unique
      jarFilterRegex - a regex to filter the jars to search for materials. E.g. ".*jme3-core.*" will search the core jme library
      outputPackage - the package where the generated materials will be placed. E.g. "org.jme3.core.materials"
    • localMaterialsSearch

      public void localMaterialsSearch(String outputPackage)
      Registers a task to search for materials in the standard location of your local project. This function assumes a typical gradle structure, where the materials are in the "src/main/resources/MatDefs" directory.
      Parameters:
      outputPackage - the package where the generated materials will be placed. E.g. "com.mygame.materials"
    • localMaterialsSearch

      public void localMaterialsSearch(String outputPackage, String materialsDirectory, String resourcesDirName)
      Registers a task to search for materials in the given directory of your local project.
      Parameters:
      outputPackage - the package where the generated materials will be placed. E.g. "com.mygame.materials"
      materialsDirectory - the path relative to the module root. E.g. "src/main/resources/MatDefs" or "assets"
      resourcesDirName - the name of the resources directory. E.g. "resources" or "assets"
    • getGeneratedSourcesDirectory

      public org.gradle.api.file.DirectoryProperty getGeneratedSourcesDirectory()
      The directory under which generated sources are placed. Each task generates into its own subdirectory (named after the task). Default is "build/generated/sources/typedMaterials"
    • getGeneratedResourcesDirectory

      public org.gradle.api.file.DirectoryProperty getGeneratedResourcesDirectory()
      The directory under which generated resources are placed. Each task generates into its own subdirectory (named after the task). Default is "build/generated/resources/typedMaterials"
    • getMaterialFactoryClass

      public org.gradle.api.provider.Property<String> getMaterialFactoryClass()