本文整理汇总了Java中org.gradle.api.tasks.StopExecutionException类的典型用法代码示例。如果您正苦于以下问题:Java StopExecutionException类的具体用法?Java StopExecutionException怎么用?Java StopExecutionException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StopExecutionException类属于org.gradle.api.tasks包,在下文中一共展示了StopExecutionException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: process
import org.gradle.api.tasks.StopExecutionException; //导入依赖的package包/类
public void process(TBuildType buildType, BundleConfig bundleConfig) throws Exception {
String propfile = EnvHelper.getEnv("awoprop");
if (StringUtils.isEmpty(propfile)) {
return;
}
Properties properties = new Properties();
properties.load(new FileInputStream(propfile));
String ap_path = properties.getProperty(AP_PATH);
boolean refresh_ap = "true".equals(properties.getProperty(REFRESH_AP));
String mtl_url = properties.getProperty(MTL_URL);
if (!refresh_ap && StringUtils.isNotEmpty(ap_path) && new File(ap_path).exists()) {
//not need download
System.out.println("[awo] ap file exist");
}
if (StringUtils.isEmpty(mtl_url)) {
throw new StopExecutionException("mtl_url is not configed");
}
ap_path = ApDownloader.downloadAP(mtl_url, new File(propfile).getParentFile()).getAbsolutePath();
properties.setProperty(AP_PATH, ap_path);
properties.store(new FileOutputStream(propfile), "update path");
buildType.setBaseApFile(new File(ap_path));
bundleConfig.setAwoBuildEnabled(true);
bundleConfig.setAwoDynDeploy("true".equals(properties.getProperty(SUPPORT_DYN, "true")));
bundleConfig.setAwoApkBuild("true".equals(properties.getProperty(SUPPORT_APK, "true")));
}
开发者ID:alibaba,项目名称:atlas,代码行数:35,代码来源:AwoPropHandler.java
示例2: updateTransformTaskConfig
import org.gradle.api.tasks.StopExecutionException; //导入依赖的package包/类
/**
* Update the parameters for the transformTask
*
* @param transformTask
* @param consumedInputStreams
* @param referencedInputStreams
* @param outputStream
*/
private void updateTransformTaskConfig(TransformTask transformTask,
@NonNull Collection<TransformStream> consumedInputStreams,
@NonNull Collection<TransformStream> referencedInputStreams,
@Nullable IntermediateStream outputStream) throws IllegalAccessException {
Field consumedInputStreamsField = FieldUtils.getDeclaredField(StreamBasedTask.class,
"consumedInputStreams",
true);
Field referencedInputStreamsField = FieldUtils.getDeclaredField(StreamBasedTask.class,
"referencedInputStreams",
true);
Field outputStreamField = FieldUtils.getDeclaredField(StreamBasedTask.class,
"outputStream",
true);
if (null == consumedInputStreamsField ||
null == referencedInputStreamsField ||
null == outputStreamField) {
throw new StopExecutionException(
"The TransformTask does not has field with name: consumedInputStreams or referencedInputStreams or outputStream! Plugin version does not support!");
}
consumedInputStreamsField.set(transformTask, consumedInputStreams);
referencedInputStreamsField.set(transformTask, referencedInputStreams);
outputStreamField.set(transformTask, outputStream);
}
开发者ID:alibaba,项目名称:atlas,代码行数:33,代码来源:InjectTransformManager.java
示例3: getTransformParam
import org.gradle.api.tasks.StopExecutionException; //导入依赖的package包/类
/**
* Gets the parameters of a transformTask
*
* @param transformTask
* @return
* @throws IllegalAccessException
*/
private TransformTaskParam getTransformParam(TransformTask transformTask) throws IllegalAccessException {
TransformTaskParam transformTaskParam = new TransformTaskParam();
Field consumedInputStreamsField = FieldUtils.getDeclaredField(StreamBasedTask.class,
"consumedInputStreams",
true);
Field referencedInputStreamsField = FieldUtils.getDeclaredField(StreamBasedTask.class,
"referencedInputStreams",
true);
Field outputStreamField = FieldUtils.getDeclaredField(StreamBasedTask.class,
"outputStream",
true);
if (null == consumedInputStreamsField ||
null == referencedInputStreamsField ||
null == outputStreamField) {
throw new StopExecutionException(
"The TransformTask does not has field with name: consumedInputStreams or referencedInputStreams or outputStream! Plugin version does not support!");
}
transformTaskParam.consumedInputStreams = (Collection<TransformStream>) consumedInputStreamsField
.get(transformTask);
transformTaskParam.referencedInputStreams = (Collection<TransformStream>) referencedInputStreamsField
.get(transformTask);
transformTaskParam.outputStream = (IntermediateStream) outputStreamField.get(transformTask);
return transformTaskParam;
}
开发者ID:alibaba,项目名称:atlas,代码行数:33,代码来源:InjectTransformManager.java
示例4: setFieldValueByReflection
import org.gradle.api.tasks.StopExecutionException; //导入依赖的package包/类
protected void setFieldValueByReflection(Task task, String fieldName, Object value) {
Field field = FieldUtils.getField(task.getClass(), fieldName, true);
if (null == field) {
throw new StopExecutionException("The field with name:" +
fieldName +
" does not existed in class:" +
task.getClass().getName());
}
try {
FieldUtils.writeField(field, task, value, true);
} catch (IllegalAccessException e) {
throw new StopExecutionException(e.getMessage());
}
}
开发者ID:alibaba,项目名称:atlas,代码行数:15,代码来源:MtlBaseTaskAction.java
示例5: initClassPool
import org.gradle.api.tasks.StopExecutionException; //导入依赖的package包/类
private ClassPool initClassPool(File jar) {
final ClassPool pool = ClassPool.getDefault();
try {
File verifyFile = PathUtil.getJarFile(com.taobao.verify.Verifier.class);
pool.insertClassPath(verifyFile.getAbsolutePath());
pool.insertClassPath(jar.getAbsolutePath());
} catch (NotFoundException e) {
throw new StopExecutionException(e.getMessage());
}
return pool;
}
开发者ID:alibaba,项目名称:atlas,代码行数:12,代码来源:DexBuildTask.java
示例6: taskAction
import org.gradle.api.tasks.StopExecutionException; //导入依赖的package包/类
/**
* Actual entry point for the action.
* Calls out to the doTaskAction as needed.
*/
@TaskAction
public void taskAction() throws InterruptedException, ProcessException, IOException {
Collection<File> _inputFiles = getInputFiles();
File _inputDir = getInputDir();
if (_inputFiles == null && _inputDir == null) {
throw new StopExecutionException("Dex task " +
getName() +
": inputDir and inputFiles cannot both be null");
}
doTaskAction(_inputFiles, _inputDir, false);
}
开发者ID:alibaba,项目名称:atlas,代码行数:16,代码来源:AwbDexTask.java
示例7: recordApkFileInfos
import org.gradle.api.tasks.StopExecutionException; //导入依赖的package包/类
/**
* Records resource information for apk files
*/
public static ApkFiles recordApkFileInfos(AppVariantContext appVariantContext) {
ApkFiles apkFiles = new ApkFiles();
List<File> mainBundleResFolders = new ArrayList<File>();
mainBundleResFolders.add(appVariantContext.getScope().getVariantData().mergeResourcesTask.getOutputDir());
prepareApkFileList(appVariantContext.getScope().getVariantData().mergeAssetsTask.getOutputDir(),
"assets", apkFiles);
for (File resFolder : mainBundleResFolders) {
prepareApkFileList(resFolder, "res", apkFiles);
}
// Record the resource information for each bundle
AtlasDependencyTree dependencyTree = AtlasBuildContext.androidDependencyTrees.get(appVariantContext.getScope().
getVariantConfiguration().getFullName());
if (null == dependencyTree) {
throw new StopExecutionException("DependencyTree cannot be null!");
}
List<AwbBundle> libs = dependencyTree.getAwbBundles();
for (AwbBundle awbLib : libs) {
File mergeAssertFolder = appVariantContext.getMergeAssets(awbLib);
File mergeResFolder = appVariantContext.getMergeResources(awbLib);
String awbName = awbLib.getName();
prepareApkFileList(mergeAssertFolder, "assets", awbName, apkFiles);
prepareApkFileList(mergeResFolder, "res", awbName, apkFiles);
}
return apkFiles;
}
开发者ID:alibaba,项目名称:atlas,代码行数:35,代码来源:ApkFileListUtils.java
示例8: processAwbResources
import org.gradle.api.tasks.StopExecutionException; //导入依赖的package包/类
/**
* Deal with awb resources
*
* @param aaptCommand
* @param enforceUniquePackageName
* @param processOutputHandler
* @param mainSymbolFile
*/
public void processAwbResources(AaptPackageProcessBuilder aaptCommand,
boolean enforceUniquePackageName,
ProcessOutputHandler processOutputHandler,
File mainSymbolFile) throws IOException, InterruptedException, ProcessException {
if (!atlasExtension.getTBuildConfig().getUseCustomAapt()) {
throw new StopExecutionException("Must set useCustomAapt value to true for awb build!");
}
checkState(getTargetInfo() != null,
"Cannot call processResources() before setTargetInfo() is called.");
// launch aapt: create the command line
ProcessInfo processInfo = aaptCommand.build(getTargetInfo().getBuildTools(),
getTargetInfo().getTarget(),
getLogger());
processInfo = new TProcessInfo(processInfo, aaptCommand.getSymbolOutputDir());
// Print log
// if (null != getLogger()) {
// getLogger().info("[Aapt]" + processInfo.getExecutable() + " "
// + StringUtils.join(processInfo.getArgs(), " "));
// }
ProcessResult result = getProcessExecutor().execute(processInfo, processOutputHandler);
result.rethrowFailure().assertNormalExitValue();
processAwbSymbols(aaptCommand, mainSymbolFile, enforceUniquePackageName);
}
开发者ID:alibaba,项目名称:atlas,代码行数:38,代码来源:AtlasBuilder.java
示例9: stopExecution
import org.gradle.api.tasks.StopExecutionException; //导入依赖的package包/类
public static Action<ExecResult> stopExecution() {
return new Action<ExecResult>() {
public void execute(ExecResult exec) {
if (exec.getExitValue() != 0) {
LOG.info("External process returned exit code: {}. Stopping the execution of the task.");
//Cleanly stop executing the task, without making the task failed.
throw new StopExecutionException();
}
}
};
}
开发者ID:mockito,项目名称:shipkit,代码行数:12,代码来源:ExecCommandFactory.java
示例10: apply
import org.gradle.api.tasks.StopExecutionException; //导入依赖的package包/类
@Override
public void apply(final Project project) {
if (!hasAndroidPlugin(project)) {
throw new StopExecutionException("No 'android' or 'android-library' plugin detected.");
}
final AppVersionExtension ext = project.getExtensions().create("appversion", AppVersionExtension.class);
try {
ext.setCode(getGitTags(project));
ext.setName(getGitTagDescriptions(project));
} catch (Throwable t) {
//todo
}
}
开发者ID:mitchwongho,项目名称:appversion-plugin,代码行数:15,代码来源:AppVersionPlugin.java
示例11: getRevision
import org.gradle.api.tasks.StopExecutionException; //导入依赖的package包/类
public SVNRevision getRevision() {
if (revision == null) {
return SVNRevision.HEAD;
}
SVNRevision svnr = SVNRevision.parse(revision);
if (SVNRevision.UNDEFINED.equals(svnr)) {
getLogger().error("--> revision " + revision +" is invalid");
throw new StopExecutionException();
}
return svnr;
}
开发者ID:christian-weber,项目名称:gradle-release-plugin,代码行数:13,代码来源:SVNInfo.java
示例12: stopExecutionIfEmpty
import org.gradle.api.tasks.StopExecutionException; //导入依赖的package包/类
public FileCollection stopExecutionIfEmpty() {
if (isEmpty()) {
throw new StopExecutionException(String.format("%s does not contain any files.", getCapDisplayName()));
}
return this;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:7,代码来源:AbstractFileCollection.java
示例13: stopExecutionIfEmpty
import org.gradle.api.tasks.StopExecutionException; //导入依赖的package包/类
public FileCollection stopExecutionIfEmpty() throws StopExecutionException {
return getDelegate().stopExecutionIfEmpty();
}
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:4,代码来源:DelegatingFileCollection.java
示例14: executeGnagCheck
import org.gradle.api.tasks.StopExecutionException; //导入依赖的package包/类
private void executeGnagCheck() {
final Set<Violation> allDetectedViolations = new HashSet<>();
violationDetectors
.stream()
.filter(ViolationDetector::isEnabled)
.forEach(violationDetector -> {
if (violationDetector instanceof BaseExecutedViolationDetector) {
((BaseExecutedViolationDetector) violationDetector).executeReporter();
}
final List<Violation> detectedViolations = violationDetector.getDetectedViolations();
allDetectedViolations.addAll(detectedViolations);
System.out.println(
violationDetector.name() + " detected " + detectedViolations.size() + " violations.");
});
final File reportsDir = projectHelper.getReportsDir();
if (allDetectedViolations.isEmpty()) {
ReportWriter.deleteLocalReportFiles(reportsDir);
getProject().setStatus(CheckStatus.getSuccessfulCheckStatus());
System.out.println("Congrats, no poop code found!");
} else {
ReportWriter.writeLocalReportFiles(allDetectedViolations, reportsDir);
getProject().setStatus(new CheckStatus(FAILURE, allDetectedViolations));
final String failedMessage
= "One or more violation detectors has found violations. Check the report at "
+ reportsDir
+ File.separatorChar
+ REPORT_FILE_NAME + " for details.";
if (gnagPluginExtension.shouldFailOnError() && !taskExecutionGraphIncludesGnagReport()) {
throw new GradleException(failedMessage);
} else {
System.out.println(failedMessage);
throw new StopExecutionException(failedMessage);
}
}
}
开发者ID:btkelly,项目名称:gnag,代码行数:47,代码来源:GnagCheck.java
示例15: stopExecutionIfEmpty
import org.gradle.api.tasks.StopExecutionException; //导入依赖的package包/类
/**
* Throws a {@link StopExecutionException} if this collection is empty.
*
* @return this
* @throws StopExecutionException When this collection is empty.
*/
FileCollection stopExecutionIfEmpty() throws StopExecutionException;
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:FileCollection.java
注:本文中的org.gradle.api.tasks.StopExecutionException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论