Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

Commit

Permalink
Fix flexbuilder goals code format
Browse files Browse the repository at this point in the history
  • Loading branch information
velo committed Sep 8, 2010
1 parent 5688304 commit 6e53d44
Show file tree
Hide file tree
Showing 11 changed files with 1,268 additions and 1,173 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,36 +57,36 @@ public class AbstractIdeMojo

/**
* Implies enableM2e=true
*
*
* @parameter default-value="false" expression="${useM2Home}"
*/
protected boolean useM2Repo;

/**
* List of path elements that form the roots of ActionScript class hierarchies.<BR>
* Usage:
*
*
* <pre>
* &lt;sourcePaths&gt;
* &lt;path&gt;${baseDir}/src/main/flex&lt;/path&gt;
* &lt;/sourcePaths&gt;
* </pre>
*
*
* By default use Maven source and resources folders.
*
*
* @parameter
*/
protected File[] sourcePaths;

/**
* When true resources are compiled into Application or Library. When false resources are compiled into separated
* Application or Library files. If not defined no resourceBundle generation is done
*
*
* @parameter
* @deprecated
*/
private Boolean mergeResourceBundle;

/**
* Sets the locales that should be used to generate resource bundles. <BR>
* Usage:
Expand All @@ -107,26 +107,26 @@ public class AbstractIdeMojo
* Sets the locales that the compiler uses to replace <code>{locale}</code> tokens that appear in some configuration
* values. This is equivalent to using the <code>compiler.locale</code> option of the mxmlc or compc compilers. <BR>
* Usage:
*
*
* <pre>
* &lt;compiledLocales&gt;
* &lt;locale&gt;en_US&lt;/locale&gt;
* &lt;locale&gt;pt_BR&lt;/locale&gt;
* &lt;locale&gt;es_ES&lt;/locale&gt;
* &lt;/compiledLocales&gt;
* </pre>
*
*
* @parameter
*/
protected String[] compiledLocales;

/**
* Define the base path to locate resouce bundle files Accept some special tokens:
*
*
* <pre>
* {locale} - replace by locale name
* </pre>
*
*
* @parameter default-value="${basedir}/src/main/locales/{locale}"
*/
protected String resourceBundlePath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,60 @@
import org.sonatype.flexmojos.flexbuilder.sdk.LocalSdkEntry;

/**
* Extends IdeDependency to add the scope value. Additionally
* this extension handles resolving the path to the dependency
* to fix a problem that was encountered with 64bit Windows.
* Extends IdeDependency to add the scope value. Additionally this extension handles resolving the path to the
* dependency to fix a problem that was encountered with 64bit Windows.
*
* @author Lance Linder llinder@gmail.com
*
*/
public class FbIdeDependency extends IdeDependency
public class FbIdeDependency
extends IdeDependency
{
private String path = null;
private String sourcePath = null;
private String rslUrlTemplate = null;
private String policyFileUrlTemplate = null;
private LocalSdkEntry localSdkEntry = null;

/**
* Constructor that copies values from an existing IdeDependency
* instance and addes the scope value
* @param dep
* @param scope
*/
public FbIdeDependency(IdeDependency dep, String scope)
{
this( dep, scope, null );
}

public FbIdeDependency(IdeDependency dep, String scope, LocalSdkEntry entry)
{
this.setArtifactId( dep.getArtifactId() );
this.setClassifier( dep.getClassifier() );
this.setFile( dep.getFile() );
this.setGroupId( dep.getGroupId() );
this.setScope( scope );
this.setType( dep.getType() );
this.setVersion( dep.getVersion() );
this.setEclipseProjectName( dep.getEclipseProjectName() );
this.setAddedToClasspath( dep.isAddedToClasspath() );
if( dep.getSourceAttachment() != null )
this.setSourceAttachment( dep.getSourceAttachment().getAbsoluteFile() );
this.setReferencedProject( dep.isReferencedProject() );
this.localSdkEntry = entry;
}

/**
private String path = null;

private String sourcePath = null;

private String rslUrlTemplate = null;

private String policyFileUrlTemplate = null;

private LocalSdkEntry localSdkEntry = null;

/**
* Constructor that copies values from an existing IdeDependency instance and addes the scope value
*
* @param dep
* @param scope
*/
public FbIdeDependency( IdeDependency dep, String scope )
{
this( dep, scope, null );
}

public FbIdeDependency( IdeDependency dep, String scope, LocalSdkEntry entry )
{
this.setArtifactId( dep.getArtifactId() );
this.setClassifier( dep.getClassifier() );
this.setFile( dep.getFile() );
this.setGroupId( dep.getGroupId() );
this.setScope( scope );
this.setType( dep.getType() );
this.setVersion( dep.getVersion() );
this.setEclipseProjectName( dep.getEclipseProjectName() );
this.setAddedToClasspath( dep.isAddedToClasspath() );
if ( dep.getSourceAttachment() != null )
this.setSourceAttachment( dep.getSourceAttachment().getAbsoluteFile() );
this.setReferencedProject( dep.isReferencedProject() );
this.localSdkEntry = entry;
}

/**
* dependency scope
*/
private String scope;
/**
private String scope;

/**
* Getter for <code>scope</code>.
*
* @return Returns the scope.
*/
public String getScope()
Expand All @@ -66,124 +70,134 @@ public String getScope()

/**
* Setter for <code>scope</code>.
*
* @param scope The scope to set.
*/
public void setScope( String scope )
{
this.scope = scope;
}

public void setLocalSdkEntry( LocalSdkEntry entry )
{
localSdkEntry = entry;
localSdkEntry = entry;
}

public LocalSdkEntry getLocalSdkEntry()
{
return localSdkEntry;
return localSdkEntry;
}

public Integer getLinkTypeId()
{
return getLinkType().getId();
return getLinkType().getId();
}

public LinkType getLinkType()
{
LinkType type = LinkType.MERGE;

if( scope.equals( FlexScopes.EXTERNAL ) || scope.equals( "runtime" ) ) {
type = LinkType.EXTERNAL;
} else if ( scope.equals( FlexScopes.RSL ) ) {
type = LinkType.RSL;
} else if ( scope.equals( FlexScopes.CACHING ) ) {
type = LinkType.RSL_DIGEST;
} else {
type = LinkType.MERGE; // MERGED is 1. MERGED is default.
}

return type;
}

LinkType type = LinkType.MERGE;

if ( scope.equals( FlexScopes.EXTERNAL ) || scope.equals( "runtime" ) )
{
type = LinkType.EXTERNAL;
}
else if ( scope.equals( FlexScopes.RSL ) )
{
type = LinkType.RSL;
}
else if ( scope.equals( FlexScopes.CACHING ) )
{
type = LinkType.RSL_DIGEST;
}
else
{
type = LinkType.MERGE; // MERGED is 1. MERGED is default.
}

return type;
}

public String getPolicyFileUrl()
{
String url = policyFileUrlTemplate;
url = StringUtils.replace( url, "{groupId}", getGroupId() );
url = StringUtils.replace( url, "{artifactId}", getArtifactId() );
url = StringUtils.replace( url, "{version}", getVersion() );
return url;
String url = policyFileUrlTemplate;

url = StringUtils.replace( url, "{groupId}", getGroupId() );
url = StringUtils.replace( url, "{artifactId}", getArtifactId() );
url = StringUtils.replace( url, "{version}", getVersion() );

return url;
}

public void setPolicyFileUrl( String template )
{
policyFileUrlTemplate = template;
policyFileUrlTemplate = template;
}

public String getRslUrl( String extension )
{
String url = rslUrlTemplate;
url = StringUtils.replace( url, "{groupId}", getGroupId() );
url = StringUtils.replace( url, "{artifactId}", getArtifactId() );
url = StringUtils.replace( url, "{version}", getVersion() );
url = StringUtils.replace( url, "{extension}", extension );
return url;
String url = rslUrlTemplate;

url = StringUtils.replace( url, "{groupId}", getGroupId() );
url = StringUtils.replace( url, "{artifactId}", getArtifactId() );
url = StringUtils.replace( url, "{version}", getVersion() );
url = StringUtils.replace( url, "{extension}", extension );

return url;
}

public void setRslUrl( String template )
{
rslUrlTemplate = template;
rslUrlTemplate = template;
}

public void setPath( String path )
{
this.path = path;
this.path = path;
}

public String getPath()
{
if( localSdkEntry != null )
{
return localSdkEntry.getPath();
}
else if( path == null )
{
path = this.getFile().getAbsolutePath();
}
return path;
if ( localSdkEntry != null )
{
return localSdkEntry.getPath();
}
else if ( path == null )
{
path = this.getFile().getAbsolutePath();
}
return path;
}
public void setSourcePath(String path)

public void setSourcePath( String path )
{
this.sourcePath = path;
this.sourcePath = path;
}

public String getSourcePath()
{
if( localSdkEntry != null )
{
return localSdkEntry.getSourcePath();
}
return sourcePath;
}
{
if ( localSdkEntry != null )
{
return localSdkEntry.getSourcePath();
}

return sourcePath;
}

public boolean isFlexSdkDependency()
{
return ( localSdkEntry != null ||
( "rb.swc".equals( getType() ) && "com.adobe.flex.framework".equals( getGroupId() ) ) );
return ( localSdkEntry != null || ( "rb.swc".equals( getType() ) && "com.adobe.flex.framework".equals( getGroupId() ) ) );
}

public boolean isModifiedFlexSdkDependency()
{
boolean modified = false;

if( isFlexSdkDependency() )
{
// TODO resolve if this dependency is different from the base.
}

return modified;
}


boolean modified = false;

if ( isFlexSdkDependency() )
{
// TODO resolve if this dependency is different from the base.
}

return modified;
}

}
Loading

0 comments on commit 6e53d44

Please sign in to comment.