Refine search
private boolean matchesTarget( Artifact found ) { return found.getGroupId().equals( target.getGroupId() ) && found.getArtifactId().equals( target.getArtifactId() ) && found.getVersion().equals( target.getVersion() ) && found.getType().equals( target.getType() ) && classifierMatch( found.getClassifier(), target.getClassifier() ) ; }
File getTouchfile( Artifact artifact ) { StringBuilder sb = new StringBuilder( 128 ); sb.append( artifact.getArtifactId() ); sb.append( '-' ).append( artifact.getBaseVersion() ); if ( artifact.getClassifier() != null ) { sb.append( '-' ).append( artifact.getClassifier() ); } sb.append( '.' ).append( artifact.getType() ).append( LAST_UPDATE_TAG ); return new File( artifact.getFile().getParentFile(), sb.toString() ); }
private ModelSource createStubModelSource( Artifact artifact ) { StringBuilder buffer = new StringBuilder( 1024 ); buffer.append( "<?xml version='1.0'?>" ); buffer.append( "<project>" ); buffer.append( "<modelVersion>4.0.0</modelVersion>" ); buffer.append( "<groupId>" ).append( artifact.getGroupId() ).append( "</groupId>" ); buffer.append( "<artifactId>" ).append( artifact.getArtifactId() ).append( "</artifactId>" ); buffer.append( "<version>" ).append( artifact.getBaseVersion() ).append( "</version>" ); buffer.append( "<packaging>" ).append( artifact.getType() ).append( "</packaging>" ); buffer.append( "</project>" ); return new StringModelSource( buffer, artifact.getId() ); }
/** * Generate correct R.java for apklibs dependencies of a current project * * @throws MojoExecutionException */ private void generateCorrectRJavaForApklibDependencies( ResourceClassGenerator resourceGenerator ) throws MojoExecutionException { getLog().debug( "" ); getLog().debug( "#generateCorrectRJavaFoApklibDeps" ); // Generate R.java for apklibs // Compatibility with Apklib which isn't present in AndroidBuilder getLog().debug( "Generating Rs for apklib deps of project " + project.getArtifact() ); final Set<Artifact> apklibDependencies = getTransitiveDependencyArtifacts( APKLIB ); for ( final Artifact artifact : apklibDependencies ) { getLog().debug( "Generating apklib R.java for " + artifact.getArtifactId() + "..." ); generateRForApkLibDependency( artifact ); } // Generate corrected R.java for APKLIB dependencies, but only if this is an APK build. if ( !apklibDependencies.isEmpty() && APK.equals( project.getArtifact().getType() ) ) { // Generate R.java for each APKLIB based on R.txt getLog().debug( "" ); getLog().debug( "Rewriting R files for APKLIB dependencies : " + apklibDependencies ); resourceGenerator.generateLibraryRs( apklibDependencies ); } }
protected AbstractArtifactResolutionException( String message, Artifact artifact, List<ArtifactRepository> remoteRepositories, Throwable t ) { this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), artifact.getClassifier(), remoteRepositories, artifact.getDependencyTrail(), t ); this.artifact = artifact; }
final String type = artifact.getType(); if ( type.equals( APKLIB ) && !instrumentationTest ) getLog().info( "Extracting apklib " + artifact.getArtifactId() + "..." ); extractApklib( artifact ); getLog().info( "Extracting aar " + artifact.getArtifactId() + "..." ); extractAarLib( artifact ); getLog().info( "Extracting apk " + artifact.getArtifactId() + "..." ); extractApkClassesJar( artifact );
protected AbstractArtifactResolutionException( String message, Artifact artifact, List<ArtifactRepository> remoteRepositories, Throwable t ) { this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), artifact.getClassifier(), remoteRepositories, artifact.getDependencyTrail(), t ); this.artifact = artifact; }
artifactSet.getExcludes() ) ) if ( artifact.getType().equals( Const.ArtifactType.NATIVE_SYMBOL_OBJECT ) || artifact.getType().equals( Const.ArtifactType.NATIVE_IMPLEMENTATION_ARCHIVE ) ) else if ( artifact.getType().equals( APKLIB ) ) else if ( artifact.getType().equals( AAR ) ) else if ( artifact.getType().equals( APK ) ) getLog().debug( "Extracting APK classes to target/classes : " + artifact.getArtifactId() ); final File apkClassesJar = getUnpackedLibHelper().getJarFileForApk( artifact ); getLog().debug( "Extracting APK : " + apkClassesJar + " to " + targetDirectory );
public ArtifactNotFoundException( String message, Artifact artifact ) { this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), artifact.getClassifier(), null, artifact.getDownloadUrl(), artifact.getDependencyTrail() ); }
protected ArtifactNotFoundException( String message, Artifact artifact, List<ArtifactRepository> remoteRepositories, Throwable cause ) { this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), artifact.getClassifier(), remoteRepositories, artifact.getDownloadUrl(), artifact.getDependencyTrail(), cause ); }
public ArtifactNotFoundException( String message, Artifact artifact ) { this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), artifact.getClassifier(), null, artifact.getDownloadUrl(), artifact.getDependencyTrail() ); }
protected ArtifactNotFoundException( String message, Artifact artifact, List<ArtifactRepository> remoteRepositories, Throwable cause ) { this( message, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), artifact.getClassifier(), remoteRepositories, artifact.getDownloadUrl(), artifact.getDependencyTrail(), cause ); }
if ( !a.getGroupId().equals( groupId ) ) else if ( !a.getArtifactId().equals( artifactId ) ) else if ( !a.getType().equals( type ) )
public AttachedArtifact( Artifact parent, String type, String classifier, ArtifactHandler artifactHandler ) { super( parent.getGroupId(), parent.getArtifactId(), parent.getVersionRange(), parent.getScope(), type, classifier, artifactHandler, parent.isOptional() ); setDependencyTrail( Collections.singletonList( parent.getId() ) ); this.parent = parent; if ( getId().equals( parent.getId() ) ) { throw new InvalidArtifactRTException( parent.getGroupId(), parent.getArtifactId(), parent.getVersion(), parent.getType(), "An attached artifact must have a different ID than its corresponding main artifact." ); } }
if ( !a.getGroupId().equals( groupId ) ) else if ( !a.getArtifactId().equals( artifactId ) ) else if ( !a.getType().equals( type ) )
private static int artifactHashCode( Artifact a ) { int result = 17; result = 31 * result + a.getGroupId().hashCode(); result = 31 * result + a.getArtifactId().hashCode(); result = 31 * result + a.getType().hashCode(); if ( a.getVersion() != null ) { result = 31 * result + a.getVersion().hashCode(); } result = 31 * result + ( a.getClassifier() != null ? a.getClassifier().hashCode() : 0 ); result = 31 * result + ( a.getScope() != null ? a.getScope().hashCode() : 0 ); result = 31 * result + ( a.getDependencyFilter() != null ? a.getDependencyFilter().hashCode() : 0 ); result = 31 * result + ( a.isOptional() ? 1 : 0 ); return result; }
/** * Gets the repository conflict id of the specified artifact. Unlike the dependency conflict id, the repository * conflict id uses the artifact file extension instead of the artifact type. Hence, the repository conflict id more * closely reflects the identity of artifacts as perceived by a repository. * * @param artifact The artifact, must not be <code>null</code>. * @return The repository conflict id, never <code>null</code>. */ private String getRepositoryConflictId( Artifact artifact ) { StringBuffer buffer = new StringBuffer( 128 ); buffer.append( artifact.getGroupId() ); buffer.append( ':' ).append( artifact.getArtifactId() ); if ( artifact.getArtifactHandler() != null ) { buffer.append( ':' ).append( artifact.getArtifactHandler().getExtension() ); } else { buffer.append( ':' ).append( artifact.getType() ); } if ( artifact.hasClassifier() ) { buffer.append( ':' ).append( artifact.getClassifier() ); } return buffer.toString(); }
private static String constructMessage( List<Artifact> artifacts ) { StringBuilder buffer = new StringBuilder( 256 ); buffer.append( "Missing:\n" ); buffer.append( "----------\n" ); int counter = 0; for ( Artifact artifact : artifacts ) { String message = ( ++counter ) + ") " + artifact.getId(); buffer.append( constructMissingArtifactMessage( message, " ", artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), artifact.getClassifier(), artifact.getDownloadUrl(), artifact.getDependencyTrail() ) ); } buffer.append( "----------\n" ); int size = artifacts.size(); buffer.append( size ).append( " required artifact" ); if ( size > 1 ) { buffer.append( "s are" ); } else { buffer.append( " is" ); } buffer.append( " missing.\n\nfor artifact: " ); return buffer.toString(); }
private static String constructMessage( List<Artifact> artifacts ) { StringBuilder buffer = new StringBuilder( 256 ); buffer.append( "Missing:\n" ); buffer.append( "----------\n" ); int counter = 0; for ( Artifact artifact : artifacts ) { String message = ( ++counter ) + ") " + artifact.getId(); buffer.append( constructMissingArtifactMessage( message, " ", artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType(), artifact.getClassifier(), artifact.getDownloadUrl(), artifact.getDependencyTrail() ) ); } buffer.append( "----------\n" ); int size = artifacts.size(); buffer.append( size ).append( " required artifact" ); if ( size > 1 ) { buffer.append( "s are" ); } else { buffer.append( " is" ); } buffer.append( " missing.\n\nfor artifact: " ); return buffer.toString(); }
public AttachedArtifact( Artifact parent, String type, String classifier, ArtifactHandler artifactHandler ) { super( parent.getGroupId(), parent.getArtifactId(), parent.getVersionRange(), parent.getScope(), type, classifier, artifactHandler, parent.isOptional() ); setDependencyTrail( Collections.singletonList( parent.getId() ) ); this.parent = parent; if ( getId().equals( parent.getId() ) ) { throw new InvalidArtifactRTException( parent.getGroupId(), parent.getArtifactId(), parent.getVersion(), parent.getType(), "An attached artifact must have a different ID" + " than its corresponding main artifact." ); } }