Skip to content

Instantly share code, notes, and snippets.

@emartynov
Last active November 13, 2016 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emartynov/206a7e0886fafee2264f58819ba10aab to your computer and use it in GitHub Desktop.
Save emartynov/206a7e0886fafee2264f58819ba10aab to your computer and use it in GitHub Desktop.
Environment gradle file
afterEvaluate {
def sdkPath = prepareAndroidHome()
copyLicenseFiles( sdkPath )
}
private void copyLicenseFiles( String sdkPath )
{
def destinationDir = new File( sdkPath )
if ( !destinationDir.exists() )
{
destinationDir.mkdirs()
}
destinationDir = new File( "${destinationDir}/licenses" )
if ( !destinationDir.exists() )
{
destinationDir.mkdirs()
}
def sourceDir = file( "${project.rootDir}/extra/licenses" )
files { sourceDir.listFiles() }.forEach {
def licenseFile = file( "${destinationDir}/${it.name}" )
if ( !licenseFile.exists() )
{
copy {
from( sourceDir )
into( destinationDir )
include( licenseFile.name )
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment