Coverage Report - com.simpligility.maven.plugins.androidndk.phase05compile.MakefileHelper
 
Classes in this File Line Coverage Branch Coverage Complexity
MakefileHelper
0%
0/159
0%
0/48
2.5
MakefileHelper$1
0%
0/2
0%
0/2
2.5
MakefileHelper$LibraryDetails
0%
0/1
N/A
2.5
MakefileHelper$MakefileRequest
0%
0/1
N/A
2.5
MakefileHelper$MakefileResponse
0%
0/28
0%
0/8
2.5
 
 1  
 package com.simpligility.maven.plugins.androidndk.phase05compile;
 2  
 
 3  
 import com.simpligility.maven.plugins.androidndk.common.AndroidExtension;
 4  
 import com.simpligility.maven.plugins.androidndk.common.ArtifactResolverHelper;
 5  
 import com.simpligility.maven.plugins.androidndk.common.Const;
 6  
 import com.simpligility.maven.plugins.androidndk.common.JarHelper;
 7  
 import com.simpligility.maven.plugins.androidndk.common.MavenToPlexusLogAdapter;
 8  
 import com.simpligility.maven.plugins.androidndk.common.NativeHelper;
 9  
 import com.simpligility.maven.plugins.androidndk.common.UnpackedLibHelper;
 10  
 import com.simpligility.maven.plugins.androidndk.configuration.IgnoreHeaderFilesArchive;
 11  
 import org.apache.commons.io.FileUtils;
 12  
 import org.apache.commons.io.FilenameUtils;
 13  
 import org.apache.commons.io.filefilter.TrueFileFilter;
 14  
 import org.apache.maven.artifact.Artifact;
 15  
 import org.apache.maven.artifact.DefaultArtifact;
 16  
 import org.apache.maven.artifact.handler.ArtifactHandler;
 17  
 import org.apache.maven.plugin.MojoExecutionException;
 18  
 import org.apache.maven.plugin.logging.Log;
 19  
 import org.apache.maven.project.MavenProject;
 20  
 
 21  
 import java.io.File;
 22  
 import java.io.IOException;
 23  
 import java.util.ArrayList;
 24  
 import java.util.Collection;
 25  
 import java.util.HashSet;
 26  
 import java.util.List;
 27  
 import java.util.Set;
 28  
 import java.util.jar.JarEntry;
 29  
 import java.util.jar.JarFile;
 30  
 
 31  
 /**
 32  
  * Various helper methods for dealing with Android Native makefiles.
 33  
  *
 34  
  * @author Johan Lindquist
 35  
  */
 36  
 public class MakefileHelper
 37  
 {
 38  0
     public static class MakefileRequest
 39  
     {
 40  
         Set<Artifact> artifacts;
 41  
         String defaultNDKArchitecture;
 42  
         boolean useHeaderArchives;
 43  
         boolean leaveTemporaryBuildArtifacts;
 44  
         String[] architectures;
 45  
         List<IgnoreHeaderFilesArchive> ignoreHeaderFilesArchives;
 46  
     }
 47  
 
 48  
 
 49  0
     private class LibraryDetails
 50  
     {
 51  
         Artifact artifact;
 52  
         Artifact harArtifact;
 53  
 
 54  
         String architecture;
 55  
         String localModule;
 56  
         File libraryPath;
 57  
         String localSrcFiles;
 58  
         String localModuleFileName;
 59  
 
 60  
         boolean useHeaderArchives;
 61  
         boolean leaveTemporaryBuildArtifacts;
 62  
 
 63  
         List<File> includeDirectories;
 64  
         MakefileResponse makefileResponse;
 65  
     }
 66  
 
 67  
     public static final String MAKEFILE_CAPTURE_FILE = "ANDROID_MAVEN_PLUGIN_LOCAL_C_INCLUDES_FILE";
 68  
     
 69  
     /**
 70  
      * Holder for the result of creating a makefile.  This in particular keep tracks of all directories created
 71  
      * for extracted header files.
 72  
      */
 73  
     public static class MakefileResponse
 74  
     {
 75  
         final boolean leaveTemporaryBuildArtifacts;
 76  
         final StringBuilder makeFile;
 77  
         final List<File> includeDirectories;
 78  0
         private Set<String> staticLibraryList = new HashSet<String> (  );
 79  0
         private Set<String> sharedLibraryList = new HashSet<String> (  );
 80  
 
 81  
         public MakefileResponse ( List<File> includeDirectories, StringBuilder makeFile, boolean leaveTemporaryBuildArtifacts )
 82  0
         {
 83  0
             this.includeDirectories = includeDirectories;
 84  0
             this.makeFile = makeFile;
 85  0
             this.leaveTemporaryBuildArtifacts = leaveTemporaryBuildArtifacts;
 86  0
         }
 87  
 
 88  
         public List<File> getIncludeDirectories()
 89  
         {
 90  0
             return includeDirectories;
 91  
         }
 92  
 
 93  
         public String getMakeFile()
 94  
         {
 95  0
             return makeFile.toString ();
 96  
         }
 97  
 
 98  
         public boolean isLeaveTemporaryBuildArtifacts()
 99  
         {
 100  0
             return leaveTemporaryBuildArtifacts;
 101  
         }
 102  
 
 103  
         public boolean hasStaticLibraryDepdendencies ()
 104  
         {
 105  0
             return !staticLibraryList.isEmpty ();
 106  
         }
 107  
 
 108  
         public String getStaticLibraryList ()
 109  
         {
 110  0
             StringBuilder sb = new StringBuilder (  );
 111  0
             for ( String staticLibraryName : staticLibraryList )
 112  
             {
 113  0
                 sb.append ( staticLibraryName );
 114  0
                 sb.append ( " " );
 115  0
             }
 116  0
             return sb.toString ();
 117  
         }
 118  
 
 119  
         public void addStaticLibraryName( final String staticLibraryName )
 120  
         {
 121  0
             staticLibraryList.add ( staticLibraryName );
 122  0
         }
 123  
 
 124  
         public boolean hasSharedLibraryDepdendencies ()
 125  
         {
 126  0
             return !sharedLibraryList.isEmpty ();
 127  
         }
 128  
 
 129  
         public String getSharedLibraryList ()
 130  
         {
 131  0
             StringBuilder sb = new StringBuilder (  );
 132  0
             for ( String sharedLibraryName : sharedLibraryList )
 133  
             {
 134  0
                 sb.append ( sharedLibraryName );
 135  0
                 sb.append ( " " );
 136  0
             }
 137  0
             return sb.toString ();
 138  
         }
 139  
 
 140  
         public void addSharedLibraryName( final String sharedLibraryName )
 141  
         {
 142  0
             sharedLibraryList.add ( sharedLibraryName );
 143  0
         }
 144  
 
 145  
     }
 146  
 
 147  
     private final MavenProject project;
 148  
     private final Log log;
 149  
     private final ArtifactResolverHelper artifactResolverHelper;
 150  
     private final ArtifactHandler harArtifactHandler;
 151  
     private final File unpackedApkLibsDirectory;
 152  
     private final File ndkBuildDirectory;
 153  
 
 154  
     /**
 155  
      * Initialize the MakefileHelper by storing the supplied parameters to local variables.
 156  
      * @param log                       Log to which to write log output.
 157  
      * @param artifactResolverHelper    ArtifactResolverHelper to use to resolve the artifacts.
 158  
      * @param harHandler                ArtifactHandler for har files.
 159  
      * @param unpackedApkLibsDirectory  Folder in which apklibs are unpacked.
 160  
      */
 161  
     public MakefileHelper( final MavenProject project, final Log log, final ArtifactResolverHelper artifactResolverHelper,
 162  
                            final ArtifactHandler harHandler, final File unpackedApkLibsDirectory, final File ndkBuildDirectory )
 163  0
     {
 164  0
         this.project = project;
 165  0
         this.log = log;
 166  0
         this.artifactResolverHelper = artifactResolverHelper;
 167  0
         this.harArtifactHandler = harHandler;
 168  0
         this.unpackedApkLibsDirectory = unpackedApkLibsDirectory;
 169  0
         this.ndkBuildDirectory = ndkBuildDirectory;
 170  0
     }
 171  
     
 172  
     /**
 173  
      * Cleans up all include directories created in the temp directory during the build.
 174  
      *
 175  
      * @param makefileResponse The holder produced by the
 176  
      * {@link MakefileHelper#createMakefileFromArtifacts(Set, String, String, boolean)}
 177  
      */
 178  
     public static void cleanupAfterBuild( final MakefileResponse makefileResponse )
 179  
     {
 180  0
         if ( !makefileResponse.isLeaveTemporaryBuildArtifacts() )
 181  
         {
 182  0
             if ( makefileResponse.getIncludeDirectories() != null )
 183  
             {
 184  0
                 for ( File file : makefileResponse.getIncludeDirectories() )
 185  
                 {
 186  
                     try
 187  
                     {
 188  0
                         FileUtils.deleteDirectory( file );
 189  
                     }
 190  0
                     catch ( IOException e )
 191  
                     {
 192  0
                         e.printStackTrace();
 193  0
                     }
 194  0
                 }
 195  
             }
 196  
         }
 197  0
     }
 198  
 
 199  
     /**
 200  
      * Creates an Android Makefile based on the specified set of static library dependency artifacts.
 201  
      *
 202  
      * @param artifacts         The list of (static library) dependency artifacts to create the Makefile from
 203  
      * @param useHeaderArchives If true, the Makefile should include a LOCAL_EXPORT_C_INCLUDES statement, pointing to
 204  
      *                          the location where the header archive was expanded
 205  
      * @return The created Makefile
 206  
      */
 207  
     public MakefileResponse createMakefileFromArtifacts ( MakefileRequest makefileRequest )
 208  
             throws IOException, MojoExecutionException
 209  
     {
 210  0
         final List<File> includeDirectories = new ArrayList<File>();
 211  0
         final StringBuilder makeFile = new StringBuilder( "# Generated by Android Maven Plugin\n" );
 212  
 
 213  0
         final MakefileResponse makefileResponse = new MakefileResponse ( includeDirectories, makeFile, makefileRequest.leaveTemporaryBuildArtifacts );
 214  
 
 215  0
         final Set<Artifact> artifacts = makefileRequest.artifacts;
 216  
 
 217  
         // Add now output - allows us to somewhat intelligently determine the include paths to use for the header
 218  
         // archive
 219  0
         makeFile.append( "$(shell echo \"LOCAL_C_INCLUDES=$(LOCAL_C_INCLUDES)\" > $(" + MAKEFILE_CAPTURE_FILE + "))" );
 220  0
         makeFile.append( '\n' );
 221  0
         makeFile.append( "$(shell echo \"LOCAL_PATH=$(LOCAL_PATH)\" >> $(" + MAKEFILE_CAPTURE_FILE + "))" );
 222  0
         makeFile.append( '\n' );
 223  0
         makeFile.append( "$(shell echo \"LOCAL_MODULE=$(LOCAL_MODULE)\" >> $(" + MAKEFILE_CAPTURE_FILE + "))" );
 224  0
         makeFile.append( '\n' );
 225  0
         makeFile.append( "$(shell echo \"LOCAL_MODULE_FILENAME=$(LOCAL_MODULE_FILENAME)\" >> $("
 226  
                 + MAKEFILE_CAPTURE_FILE + "))" );
 227  0
         makeFile.append( '\n' );
 228  0
         makeFile.append( "$(shell echo \"LOCAL_CFLAGS=$(LOCAL_CFLAGS)\" >> $(" + MAKEFILE_CAPTURE_FILE + "))" );
 229  0
         makeFile.append( '\n' );
 230  0
         makeFile.append( "$(shell echo \"LOCAL_SHARED_LIBRARIES=$(LOCAL_SHARED_LIBRARIES)\" >> $(" + MAKEFILE_CAPTURE_FILE + "))" );
 231  0
         makeFile.append( '\n' );
 232  0
         makeFile.append( "$(shell echo \"LOCAL_STATIC_LIBRARIES=$(LOCAL_STATIC_LIBRARIES)\" >> $(" + MAKEFILE_CAPTURE_FILE + "))" );
 233  0
         makeFile.append( '\n' );
 234  0
         makeFile.append( "$(shell echo \"LOCAL_EXPORT_C_INCLUDES=$(LOCAL_EXPORT_C_INCLUDES)\" >> $(" + MAKEFILE_CAPTURE_FILE + "))" );
 235  0
         makeFile.append( '\n' );
 236  0
         makeFile.append( "$(shell echo \"LOCAL_SRC_FILES=$(LOCAL_SRC_FILES)\" >> $(" + MAKEFILE_CAPTURE_FILE + "))" );
 237  0
         makeFile.append( '\n' );
 238  
 
 239  0
         if ( ! artifacts.isEmpty() )
 240  
         {
 241  0
             for ( Artifact artifact : artifacts )
 242  
             {
 243  
                 // If we are dealing with bundled artifacts or not (in an APKLIB or AAR for example)
 244  0
                 if ( !isLibraryBundle( artifact ) )
 245  
                 {
 246  0
                     final String architecture = NativeHelper.extractArchitectureFromArtifact ( artifact, makefileRequest.defaultNDKArchitecture );
 247  
 
 248  0
                     final LibraryDetails libraryDetails = new LibraryDetails ();
 249  
 
 250  0
                     libraryDetails.makefileResponse = makefileResponse;
 251  0
                     libraryDetails.artifact = artifact;
 252  
 
 253  0
                     libraryDetails.architecture = architecture;
 254  0
                     libraryDetails.localModule = artifact.getArtifactId ();
 255  0
                     libraryDetails.libraryPath = artifact.getFile ();
 256  
 
 257  0
                     libraryDetails.useHeaderArchives = useHeaderArchives( artifact, makefileRequest.useHeaderArchives, makefileRequest.ignoreHeaderFilesArchives );
 258  0
                     libraryDetails.leaveTemporaryBuildArtifacts = makefileRequest.leaveTemporaryBuildArtifacts;
 259  
 
 260  0
                     libraryDetails.includeDirectories = includeDirectories;
 261  
 
 262  0
                     libraryDetails.harArtifact = new DefaultArtifact ( artifact.getGroupId (), artifact.getArtifactId (),
 263  
                                           artifact.getVersion (), artifact.getScope (),
 264  
                                           Const.ArtifactType.NATIVE_HEADER_ARCHIVE, artifact.getClassifier (), harArtifactHandler );
 265  
 
 266  0
                     addLocalModule( libraryDetails );
 267  0
                 }
 268  
                 else
 269  
                 {
 270  0
                     final LibraryDetails libraryDetails = new LibraryDetails ();
 271  
 
 272  0
                     libraryDetails.makefileResponse = makefileResponse;
 273  0
                     libraryDetails.artifact = artifact;
 274  0
                     libraryDetails.useHeaderArchives = makefileRequest.useHeaderArchives;
 275  0
                     libraryDetails.leaveTemporaryBuildArtifacts = makefileRequest.leaveTemporaryBuildArtifacts;
 276  
 
 277  
                     // Collect added include directorie
 278  0
                     libraryDetails.includeDirectories = includeDirectories;
 279  
 
 280  
 
 281  0
                     addLibraryBundleDetails ( libraryDetails, makefileRequest.architectures );
 282  
                 }
 283  0
             }
 284  
         }
 285  0
         return makefileResponse;
 286  
     }
 287  
 
 288  
     private boolean useHeaderArchives ( final Artifact artifact, final boolean useHeaderArchives, final List<IgnoreHeaderFilesArchive> ignoreHeaderFilesArchives )
 289  
     {
 290  0
         if ( !useHeaderArchives )
 291  
         {
 292  0
             return false;
 293  
         }
 294  
 
 295  0
         if ( ignoreHeaderFilesArchives != null )
 296  
         {
 297  0
             for ( IgnoreHeaderFilesArchive directive : ignoreHeaderFilesArchives )
 298  
             {
 299  0
                 if ( directive.getGroupId ().equals ( artifact.getGroupId () ) && directive.getArtifactId ().equals ( artifact.getArtifactId () ) )
 300  
                 {
 301  0
                     return false;
 302  
                 }
 303  0
             }
 304  
         }
 305  0
         return true;
 306  
     }
 307  
 
 308  
 
 309  
     private void addLocalModule ( final LibraryDetails libraryDetails ) throws MojoExecutionException, IOException
 310  
     {
 311  0
         final Artifact artifact = libraryDetails.artifact;
 312  0
         final StringBuilder makeFile = libraryDetails.makefileResponse.makeFile;
 313  0
         final boolean isStaticLibrary = Const.ArtifactType.NATIVE_IMPLEMENTATION_ARCHIVE.equals ( libraryDetails.artifact.getType () );
 314  
 
 315  
 
 316  0
         makeFile.append ( '\n' );
 317  0
         makeFile.append ( "ifeq ($(TARGET_ARCH_ABI)," ).append ( libraryDetails.architecture ).append ( ")\n" );
 318  
 
 319  0
         makeFile.append ( "#\n" );
 320  0
         makeFile.append ( "# Group ID: " );
 321  0
         makeFile.append ( artifact.getGroupId () );
 322  0
         makeFile.append ( '\n' );
 323  0
         makeFile.append ( "# Artifact ID: " );
 324  0
         makeFile.append ( artifact.getArtifactId () );
 325  0
         makeFile.append ( '\n' );
 326  0
         makeFile.append ( "# Artifact Type: " );
 327  0
         makeFile.append ( artifact.getType () );
 328  0
         makeFile.append ( '\n' );
 329  0
         makeFile.append ( "# Version: " );
 330  0
         makeFile.append ( artifact.getVersion () );
 331  0
         makeFile.append ( '\n' );
 332  0
         makeFile.append ( "include $(CLEAR_VARS)" );
 333  0
         makeFile.append ( '\n' );
 334  0
         makeFile.append ( "LOCAL_MODULE    := " );
 335  0
         makeFile.append ( libraryDetails.localModule );
 336  0
         makeFile.append ( '\n' );
 337  
 
 338  0
         if ( isStaticLibrary )
 339  
         {
 340  0
             libraryDetails.makefileResponse.addStaticLibraryName ( libraryDetails.localModule );
 341  
         }
 342  
         else
 343  
         {
 344  0
             libraryDetails.makefileResponse.addSharedLibraryName ( libraryDetails.localModule );
 345  
         }
 346  
 
 347  
 
 348  0
         addLibraryDetails ( makeFile,  libraryDetails.libraryPath, artifact.getArtifactId() );
 349  
 
 350  0
         if ( libraryDetails.useHeaderArchives )
 351  
         {
 352  
             try
 353  
             {
 354  0
                 final String classifier = artifact.getClassifier ();
 355  
 
 356  0
                 File resolvedHarArtifactFile = artifactResolverHelper.resolveArtifactToFile ( libraryDetails.harArtifact );
 357  0
                 log.debug ( "Resolved har artifact file : " + resolvedHarArtifactFile );
 358  
 
 359  0
                 final File includeDir = new File ( ndkBuildDirectory, "android_maven_plugin_native_includes" + System.currentTimeMillis () + "_"
 360  
                         + libraryDetails.harArtifact.getArtifactId () );
 361  
 
 362  0
                 if ( !libraryDetails.leaveTemporaryBuildArtifacts )
 363  
                 {
 364  0
                     includeDir.deleteOnExit ();
 365  
                 }
 366  
 
 367  0
                 libraryDetails.includeDirectories.add ( includeDir );
 368  
 
 369  0
                 JarHelper.unjar ( new JarFile ( resolvedHarArtifactFile ), includeDir,
 370  
                         new JarHelper.UnjarListener ()
 371  0
                         {
 372  
                             @Override
 373  
                             public boolean include ( JarEntry jarEntry )
 374  
                             {
 375  0
                                 return !jarEntry.getName ().startsWith ( "META-INF" );
 376  
                             }
 377  
                         } );
 378  
 
 379  0
                 makeFile.append ( "LOCAL_EXPORT_C_INCLUDES := " );
 380  0
                 makeFile.append ( includeDir.getAbsolutePath () );
 381  0
                 makeFile.append ( '\n' );
 382  
 
 383  0
                 if ( log.isDebugEnabled () )
 384  
                 {
 385  0
                     Collection<File> includes = FileUtils.listFiles ( includeDir, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE );
 386  0
                     log.debug ( "Listing LOCAL_EXPORT_C_INCLUDES for " + artifact.getId () + ": " + includes );
 387  
                 }
 388  
             }
 389  0
             catch ( RuntimeException e )
 390  
             {
 391  0
                 throw new MojoExecutionException ( "Error while resolving header archive file for: " + artifact.getArtifactId (), e );
 392  0
             }
 393  
         }
 394  0
         if ( isStaticLibrary )
 395  
         {
 396  0
             makeFile.append ( "include $(PREBUILT_STATIC_LIBRARY)\n" );
 397  
         }
 398  
         else
 399  
         {
 400  0
             makeFile.append ( "include $(PREBUILT_SHARED_LIBRARY)\n" );
 401  
         }
 402  
 
 403  0
         makeFile.append ( "endif #" ).append ( artifact.getClassifier () ).append ( '\n' );
 404  0
         makeFile.append ( '\n' );
 405  
 
 406  
 
 407  
 
 408  0
     }
 409  
 
 410  
     private boolean isLibraryBundle( Artifact artifact )
 411  
     {
 412  0
         return artifact.getType ().equals ( AndroidExtension.APKLIB ) || artifact.getType ().equals ( AndroidExtension.AAR );
 413  
     }
 414  
 
 415  
     private void addLibraryBundleDetails( final LibraryDetails libraryDetails, final String[] architectures ) throws MojoExecutionException, IOException
 416  
     {
 417  0
         final Artifact artifact = libraryDetails.artifact;
 418  
 
 419  
         // At this point, we should peek at the files in the APK/AAR to see if
 420  
         // there are any native files.  If so, we should add those to the make file.
 421  
         // Also, from the list of architectures in the
 422  
 
 423  
         // So, extract the artifact, if need be
 424  0
         UnpackedLibHelper unpackedLibHelper = new UnpackedLibHelper ( artifactResolverHelper, project, new MavenToPlexusLogAdapter ( log ), unpackedApkLibsDirectory );
 425  
 
 426  0
         if ( artifact.getType ().equals ( AndroidExtension.AAR ) )
 427  
         {
 428  0
             unpackedLibHelper.extractAarLib ( artifact );
 429  
         }
 430  0
         else if ( artifact.getType ().equals ( AndroidExtension.APKLIB ) )
 431  
         {
 432  0
             unpackedLibHelper.extractApklib ( artifact );
 433  
         }
 434  
 
 435  0
         for ( int i = 0; i < architectures.length; i++ )
 436  
         {
 437  0
             String architecture = architectures[ i ];
 438  
 
 439  0
             final File[] staticLibs = NativeHelper.listNativeFiles ( artifact, unpackedLibHelper.getUnpackedLibNativesFolder ( artifact ), true, architecture );
 440  0
             processBundledLibraries( architecture, libraryDetails, staticLibs );
 441  
 
 442  0
             final File[] sharedLibs = NativeHelper.listNativeFiles ( artifact, unpackedLibHelper.getUnpackedLibNativesFolder ( artifact ), false, architecture );
 443  0
             processBundledLibraries( architecture, libraryDetails, sharedLibs );
 444  
 
 445  
         }
 446  
 
 447  0
     }
 448  
 
 449  
     private void processBundledLibraries ( final String architecture, final LibraryDetails libraryDetails, final File[] staticLibs ) throws IOException, MojoExecutionException
 450  
     {
 451  0
         final Artifact artifact = libraryDetails.artifact;
 452  
 
 453  0
         for ( File staticLib : staticLibs )
 454  
         {
 455  
             // For each static file, find the HAR artifca
 456  0
             libraryDetails.architecture = architecture;
 457  0
             libraryDetails.localModule = artifact.getArtifactId ();
 458  
 
 459  0
             libraryDetails.libraryPath = staticLib;
 460  
 
 461  0
             final String classifier = artifact.getClassifier () == null ? architecture : architecture + "-" + artifact.getClassifier ();
 462  
 
 463  0
             libraryDetails.harArtifact = new DefaultArtifact ( artifact.getGroupId (), artifact.getArtifactId (),
 464  
                     artifact.getVersion (), artifact.getScope (),
 465  
                     Const.ArtifactType.NATIVE_HEADER_ARCHIVE, classifier, harArtifactHandler );
 466  
 
 467  0
             libraryDetails.localModuleFileName = artifact.getArtifactId ();
 468  
 
 469  
 
 470  0
             addLocalModule ( libraryDetails );
 471  
 
 472  
         }
 473  0
     }
 474  
 
 475  
     private void addLibraryDetails( StringBuilder makeFile, File libFile, String outputName ) throws IOException
 476  
     {
 477  0
         makeFile.append( "LOCAL_PATH := " );
 478  0
         makeFile.append( libFile.getParentFile().getAbsolutePath() );
 479  0
         makeFile.append( '\n' );
 480  0
         makeFile.append( "LOCAL_SRC_FILES := " );
 481  0
         makeFile.append( libFile.getName() );
 482  0
         makeFile.append( '\n' );
 483  0
         makeFile.append( "LOCAL_MODULE_FILENAME := " );
 484  0
         if ( "".equals( outputName ) )
 485  
         {
 486  0
             makeFile.append( FilenameUtils.removeExtension( libFile.getName() ) );
 487  
         }
 488  
         else
 489  
         {
 490  0
             makeFile.append( outputName );
 491  
         }
 492  0
         makeFile.append( '\n' );
 493  0
     }
 494  
 
 495  
 }