All Downloads are FREE. Search and download functionalities are using the official Maven repository.

flair.gradle.tasks.PublishAtlases.groovy Maven / Gradle / Ivy

package flair.gradle.tasks

import flair.gradle.cli.ICli
import flair.gradle.cli.TexturePacker
import flair.gradle.extensions.FlairProperty
import org.gradle.api.file.FileTree
import org.gradle.api.tasks.TaskAction

/**
 * @author SamYStudiO ( [email protected] )
 */
class PublishAtlases extends AbstractTask
{
	public PublishAtlases()
	{
		group = TaskGroup.TEXTURE_PACKER.name
		description = ""
	}

	@TaskAction
	public void publishAtlases()
	{
		String moduleName = extensionManager.getFlairProperty( FlairProperty.MODULE_NAME )
		ICli tp = new TexturePacker( )

		FileTree tree = project.fileTree( "${ moduleName }/src" )

		tree.each { file ->

			if( file.name.toLowerCase( ).indexOf( ".tps" ) >= 0 )
			{
				tp.addArgument( file.path )
			}
		}

		tp.execute( project )
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy