Griffon 1.2.0

griffon.util
[Groovy] Class ArtifactSettings

java.lang.Object
  griffon.util.ArtifactSettings

class ArtifactSettings

Common utilities for dealing with artifacts such as plugins and archetypes.

Authors:
Andres Almiray
Since:
0.9.5


Field Summary
private static Pattern ARTIFACT_NAME_VERSION_PATTERN

private static Logger LOG

static String TIMESTAMP_FORMAT

 
Property Summary
static String ADDON_DESCRIPTOR_SUFFIX

static String ADDON_DESCRIPTOR_SUFFIX_JAVA

static String ARCHETYPE_DESCRIPTOR_SUFFIX

static String PLUGIN_DESCRIPTOR_SUFFIX

BuildSettings settings

 
Constructor Summary
ArtifactSettings(BuildSettings settings)

 
Method Summary
private String archetypesBase()

String artifactBase(String type, boolean framework = false)

static int compareVersions(String artifactVersion, String requiredVersion)

Compare two artifact versions

static Release createReleaseFromMetadata(String type, File file)

File[] findAllArtifactDirsForName(String type, String name, boolean framework = false)

Resource[] findAllArtifactDirsForType(String type, boolean framework = false)

File findArtifactDirForName(String type, String name, boolean framework = false)

static Resource getArchetypeDescriptor(String dir)

static Resource getArchetypeDescriptor(Resource dir)

static String getArchetypeNameFromDescriptor(Resource archetypeDescriptor)

static String getArchetypeNameFromDescriptor(String fileName)

static Resource getArtifactDescriptor(String type, String dir)

static Resource getArtifactDescriptor(String type, Resource dir)

static String getArtifactNameFromDescriptor(String type, String dir)

static String getArtifactNameFromDescriptor(String type, Resource dir)

static Release getArtifactRelease(String type, String dir)

static Release getArtifactRelease(String type, File dir)

private static def getArtifactVersionInternal(String artifactVersion, def index)

File getInstallPathFor(String type, String name, String version, boolean framework = false)

Map getInstalledArtifacts(String type, boolean framework = false)

Finds all artifacts of the given type that are installed.

Release getInstalledRelease(String type, String name, boolean framework = false)

Release getInstalledRelease(String type, String name, String version, boolean framework = false)

Map getInstalledReleases(String type, boolean framework = false)

static String getLowerVersion(String artifactVersion)

Returns the lower version of a Griffon version number expression in a artifact

static Resource getPluginDescriptor(String dir)

static Resource getPluginDescriptor(Resource dir)

static String getPluginNameFromDescriptor(Resource artifactDescriptor)

static String getPluginNameFromDescriptor(String fileName)

static Map getRegisteredArtifacts(String type, Metadata metadata = Metadata.current)

Finds all artifacts of the given type that are registered with the project's metadata.

Release getReleaseFromMetadata(String type, String name, String version = null, boolean framework = false)

static String getUpperVersion(String artifactVersion)

Returns the upper version of a Griffon version number expression in a artifact

boolean isArtifactInstalled(String type, String name, String version, boolean framework = false)

static boolean isValidVersion(String artifactVersion, String requiredVersion)

Check if the required version is a valid for the given artifact version

static Archetype parseArchetypeFromJSON(def json)

static Artifact parseArtifactFromJSON(String type, def json)

static Artifact parseArtifactFromXML(String type, def xml)

static Plugin parsePluginFromJSON(def json)

static Plugin parsePluginFromXML(def xml)

static Release parseReleaseFromJSON(def json)

static Release parseReleaseFromXML(def xml)

private String pluginsBase(boolean framework)

Resource[] resolveResources(String pattern)

static boolean supportsAtLeastVersion(String artifactVersion, String requiredVersion)

private static def trimTag(String artifactVersion)

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

ARTIFACT_NAME_VERSION_PATTERN

private static final Pattern ARTIFACT_NAME_VERSION_PATTERN


LOG

private static final Logger LOG


TIMESTAMP_FORMAT

public static final String TIMESTAMP_FORMAT


 
Property Detail

ADDON_DESCRIPTOR_SUFFIX

static final String ADDON_DESCRIPTOR_SUFFIX


ADDON_DESCRIPTOR_SUFFIX_JAVA

static final String ADDON_DESCRIPTOR_SUFFIX_JAVA


ARCHETYPE_DESCRIPTOR_SUFFIX

static final String ARCHETYPE_DESCRIPTOR_SUFFIX


PLUGIN_DESCRIPTOR_SUFFIX

static final String PLUGIN_DESCRIPTOR_SUFFIX


settings

final BuildSettings settings


 
Constructor Detail

ArtifactSettings

ArtifactSettings(BuildSettings settings)


 
Method Detail

archetypesBase

private String archetypesBase()


artifactBase

String artifactBase(String type, boolean framework = false)


compareVersions

static int compareVersions(String artifactVersion, String requiredVersion)
Compare two artifact versions
Parameters:
artifactVersion - The artifact version
requiredVersion - The required version
Returns:
0 if equal; < 0 if artifactVersion is smaller; > 0 if artifactVersion is greater


createReleaseFromMetadata

static Release createReleaseFromMetadata(String type, File file)


findAllArtifactDirsForName

File[] findAllArtifactDirsForName(String type, String name, boolean framework = false)


findAllArtifactDirsForType

Resource[] findAllArtifactDirsForType(String type, boolean framework = false)


findArtifactDirForName

File findArtifactDirForName(String type, String name, boolean framework = false)


getArchetypeDescriptor

static Resource getArchetypeDescriptor(String dir)


getArchetypeDescriptor

static Resource getArchetypeDescriptor(Resource dir)


getArchetypeNameFromDescriptor

static String getArchetypeNameFromDescriptor(Resource archetypeDescriptor)


getArchetypeNameFromDescriptor

static String getArchetypeNameFromDescriptor(String fileName)


getArtifactDescriptor

static Resource getArtifactDescriptor(String type, String dir)


getArtifactDescriptor

static Resource getArtifactDescriptor(String type, Resource dir)


getArtifactNameFromDescriptor

static String getArtifactNameFromDescriptor(String type, String dir)


getArtifactNameFromDescriptor

static String getArtifactNameFromDescriptor(String type, Resource dir)


getArtifactRelease

static Release getArtifactRelease(String type, String dir)


getArtifactRelease

static Release getArtifactRelease(String type, File dir)


getArtifactVersionInternal

private static def getArtifactVersionInternal(String artifactVersion, def index)


getInstallPathFor

File getInstallPathFor(String type, String name, String version, boolean framework = false)


getInstalledArtifacts

Map getInstalledArtifacts(String type, boolean framework = false)
Finds all artifacts of the given type that are installed.
Parameters:
type - one of Archetype.TYPE or Plugin.TYPE.
Returns:


getInstalledRelease

Release getInstalledRelease(String type, String name, boolean framework = false)


getInstalledRelease

Release getInstalledRelease(String type, String name, String version, boolean framework = false)


getInstalledReleases

Map getInstalledReleases(String type, boolean framework = false)


getLowerVersion

static String getLowerVersion(String artifactVersion)
Returns the lower version of a Griffon version number expression in a artifact


getPluginDescriptor

static Resource getPluginDescriptor(String dir)


getPluginDescriptor

static Resource getPluginDescriptor(Resource dir)


getPluginNameFromDescriptor

static String getPluginNameFromDescriptor(Resource artifactDescriptor)


getPluginNameFromDescriptor

static String getPluginNameFromDescriptor(String fileName)


getRegisteredArtifacts

static Map getRegisteredArtifacts(String type, Metadata metadata = Metadata.current)
Finds all artifacts of the given type that are registered with the project's metadata.
Parameters:
type - one of Archetype.TYPE or Plugin.TYPE.
Returns:


getReleaseFromMetadata

Release getReleaseFromMetadata(String type, String name, String version = null, boolean framework = false)


getUpperVersion

static String getUpperVersion(String artifactVersion)
Returns the upper version of a Griffon version number expression in a artifact


isArtifactInstalled

boolean isArtifactInstalled(String type, String name, String version, boolean framework = false)


isValidVersion

static boolean isValidVersion(String artifactVersion, String requiredVersion)
Check if the required version is a valid for the given artifact version
Parameters:
artifactVersion - The artifact version
requiredVersion - The required version
Returns:
true if it is valid


parseArchetypeFromJSON

static Archetype parseArchetypeFromJSON(def json)


parseArtifactFromJSON

static Artifact parseArtifactFromJSON(String type, def json)


parseArtifactFromXML

static Artifact parseArtifactFromXML(String type, def xml)


parsePluginFromJSON

static Plugin parsePluginFromJSON(def json)


parsePluginFromXML

static Plugin parsePluginFromXML(def xml)


parseReleaseFromJSON

static Release parseReleaseFromJSON(def json)


parseReleaseFromXML

static Release parseReleaseFromXML(def xml)


pluginsBase

private String pluginsBase(boolean framework)


resolveResources

Resource[] resolveResources(String pattern)


supportsAtLeastVersion

static boolean supportsAtLeastVersion(String artifactVersion, String requiredVersion)


trimTag

private static def trimTag(String artifactVersion)


 

Groovy Documentation