Last active
November 13, 2016 12:02
-
-
Save emartynov/206a7e0886fafee2264f58819ba10aab to your computer and use it in GitHub Desktop.
Environment gradle file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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