use of org.gradle.api.tasks.TaskAction in project atlas by alibaba.
the class AwoFullApkBuildTask method doTask.
@TaskAction
public void doTask() throws IOException, SigningException {
baseApkFile = getBaseApkFile();
destPath = getDestPath();
awoFile = getAwoFile();
zipAlign = getZipAlign();
outApkFile = getOutApkFile();
ZipUtils.addFileToZipFile(baseApkFile, outApkFile, awoFile, destPath, true);
File signFile = new File(outApkFile.getParent(), outApkFile.getName().replace(".apk", "-signed.apk"));
AtlasBuildContext.androidSigner.signFile(outApkFile, signFile, getSigningConfig());
if (null != zipAlign && zipAlign) {
File signAndZipAlignedFile = ZipAlignUtils.doZipAlign(androidBuilder, getProject(), signFile);
FileUtils.deleteQuietly(outApkFile);
FileUtils.moveFile(signAndZipAlignedFile, outApkFile);
}
}
use of org.gradle.api.tasks.TaskAction in project atlas by alibaba.
the class PreProcessManifestTask method preProcess.
@TaskAction
public void preProcess() throws IOException, DocumentException, InterruptedException {
getLogger().info("[MTLPlugin]Start PreProcess Lib manifest files,main manifestFile is:" + getMainManifestFile());
ExecutorServicesHelper executorServicesHelper = new ExecutorServicesHelper("preProcessDex", getLogger(), 0);
List<Runnable> runnables = new ArrayList<>();
ManifestFileObject mainManifestFileObject = ManifestFileUtils.getManifestFileObject(mainManifestFile);
mainManifestFileObject.init();
for (File file : getLibraryManifests()) {
runnables.add(new Runnable() {
@Override
public void run() {
try {
ManifestFileUtils.updatePreProcessManifestFile(file, mainManifestFileObject, true);
} catch (Throwable e) {
throw new GradleException("preprocess manifest", e);
}
}
});
}
executorServicesHelper.execute(runnables);
//ManifestFileUtils.preProcessManifests(getMainManifestFile(), getLibraryManifests(), true);
//BundleInfoUtils.setupAwbBundleInfos(appVariantOutputContext.getVariantContext());
//collectBundleInfo();
addAwbManifest2Merge();
}
use of org.gradle.api.tasks.TaskAction in project Entitas-Java by Rubentxu.
the class CodeGenerationTask method run.
@TaskAction
public void run() {
entitasProject = new EntitasGradleProject(getProject());
CodeGenerator codeGenerator = entitasProject.getCodeGenerator();
codeGenerator.generate();
}
use of org.gradle.api.tasks.TaskAction in project gradle by gradle.
the class GenerateIvyDescriptor method doGenerate.
@TaskAction
public void doGenerate() {
IvyModuleDescriptorSpecInternal descriptorInternal = toIvyModuleDescriptorInternal(getDescriptor());
IvyDescriptorFileGenerator ivyGenerator = new IvyDescriptorFileGenerator(descriptorInternal.getProjectIdentity());
ivyGenerator.setStatus(descriptorInternal.getStatus());
ivyGenerator.setBranch(descriptorInternal.getBranch());
ivyGenerator.setExtraInfo(descriptorInternal.getExtraInfo().asMap());
for (IvyConfiguration ivyConfiguration : descriptorInternal.getConfigurations()) {
ivyGenerator.addConfiguration(ivyConfiguration);
}
for (IvyArtifact ivyArtifact : descriptorInternal.getArtifacts()) {
ivyGenerator.addArtifact(ivyArtifact);
}
for (IvyDependencyInternal ivyDependency : descriptorInternal.getDependencies()) {
ivyGenerator.addDependency(ivyDependency);
}
ivyGenerator.withXml(descriptorInternal.getXmlAction()).writeTo(getDestination());
}
use of org.gradle.api.tasks.TaskAction in project gradle by gradle.
the class AbstractJettyRunTask method start.
@TaskAction
protected void start() {
ClassLoader originalClassloader = Server.class.getClassLoader();
List<File> additionalClasspath = new ArrayList<File>();
for (File additionalRuntimeJar : getAdditionalRuntimeJars()) {
additionalClasspath.add(additionalRuntimeJar);
}
URLClassLoader jettyClassloader = new URLClassLoader(new DefaultClassPath(additionalClasspath).getAsURLArray(), originalClassloader);
try {
Thread.currentThread().setContextClassLoader(jettyClassloader);
startJetty();
} finally {
Thread.currentThread().setContextClassLoader(originalClassloader);
}
}
Aggregations