• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ExecSpec类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.gradle.process.ExecSpec的典型用法代码示例。如果您正苦于以下问题:Java ExecSpec类的具体用法?Java ExecSpec怎么用?Java ExecSpec使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ExecSpec类属于org.gradle.process包,在下文中一共展示了ExecSpec类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: send

import org.gradle.process.ExecSpec; //导入依赖的package包/类
@Override
public void send(final String title, final String message) {
    final File exe = OperatingSystem.current().findInPath("notify-send");
    if (exe == null) {
        throw new AnnouncerUnavailableException("Could not find 'notify-send' in the path.");
    }

    processOperations.exec(new Action<ExecSpec>() {
        @Override
        public void execute(ExecSpec execSpec) {
            execSpec.executable(exe);
            File icon = iconProvider.getIcon(32, 32);
            if (icon != null) {
                execSpec.args("-i", icon.getAbsolutePath());
            }
            execSpec.args("--hint=int:transient:1");
            execSpec.args(title, message);
        }

    });
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:22,代码来源:NotifySend.java


示例2: send

import org.gradle.process.ExecSpec; //导入依赖的package包/类
@Override
public void send(final String title, final String message) {
    final File exe = OperatingSystem.current().findInPath("growlnotify");
    if (exe == null) {
        throw new AnnouncerUnavailableException("Could not find 'growlnotify' in path.");
    }

    processOperations.exec(new Action<ExecSpec>() {
        @Override
        public void execute(ExecSpec execSpec) {
            execSpec.executable(exe);
            execSpec.args("-m", message);
            File icon = iconProvider.getIcon(48, 48);
            if (icon != null) {
                execSpec.args("--image", icon.getAbsolutePath());
            }
            execSpec.args("-t", title);
        }
    });
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:21,代码来源:GrowlNotifyBackedAnnouncer.java


示例3: exec

import org.gradle.process.ExecSpec; //导入依赖的package包/类
@TaskAction
void exec() {
  getProject().exec(new Action<ExecSpec>() {
    @Override
    public void execute(ExecSpec execSpec) {
      try {
        if (dexMergerExecutable == null) {
          dexMergerExecutable = Utils.dexMergerExecutable();
        }
        execSpec.setExecutable(dexMergerExecutable);
        execSpec.args(destination.getCanonicalPath());
        execSpec.args(source.getFiles());
      } catch (IOException e) {
        throw new UncheckedIOException(e);
      }
    }
  });
}
 
开发者ID:inferjay,项目名称:r8,代码行数:19,代码来源:DexMerger.java


示例4: doZipAlign

import org.gradle.process.ExecSpec; //导入依赖的package包/类
public static synchronized File doZipAlign(final AndroidBuilder androidBuilder, Project project, final File apkFile) {

        final File zipalignedFile = new File(apkFile.getParent(), apkFile.getName().replace(".apk", "-zipaligned.apk"));

        project.exec(new Action<ExecSpec>() {
            @Override
            public void execute(ExecSpec execSpec) {

                String path = androidBuilder.getTargetInfo()
                        .getBuildTools().getPath(ZIP_ALIGN);
                execSpec.executable(new File(path));
                execSpec.args("-f", "4");
                execSpec.args(apkFile);
                execSpec.args(zipalignedFile);
            }
        });

        return zipalignedFile;
    }
 
开发者ID:alibaba,项目名称:atlas,代码行数:20,代码来源:BuildHelper.java


示例5: getGitTags

import org.gradle.process.ExecSpec; //导入依赖的package包/类
static Integer getGitTags(final Project project) {
    final ByteArrayOutputStream baos = new ByteArrayOutputStream();
    final ExecResult res = project.exec(new Action<ExecSpec>() {
        @Override
        public void execute(final ExecSpec execSpec) {
            execSpec.commandLine("git", "tag");
            execSpec.setStandardOutput(baos);
        }
    });
    System.out.println(String.format("getGitTags:exit '%d'", res.getExitValue()));
    if (res.getExitValue() == 0) {
        final String str = baos.toString().trim();
        final int numTags = (str == null || str.length() == 0) ? 1 : str.split("\n").length;
        System.out.println(String.format("getGitTags 'num=%d'", numTags));
        return numTags;
    } else {
        return 1;
    }
}
 
开发者ID:mitchwongho,项目名称:appversion-plugin,代码行数:20,代码来源:AppVersionPlugin.java


示例6: ignoreResult

import org.gradle.process.ExecSpec; //导入依赖的package包/类
public static Action<ExecSpec> ignoreResult() {
    return new Action<ExecSpec>() {
        public void execute(ExecSpec spec) {
            spec.setIgnoreExitValue(true);
        }
    };
}
 
开发者ID:mockito,项目名称:shipkit,代码行数:8,代码来源:ExecCommandFactory.java


示例7: getGitTagDescriptions

import org.gradle.process.ExecSpec; //导入依赖的package包/类
static String getGitTagDescriptions(final Project project) {
    final ByteArrayOutputStream baos = new ByteArrayOutputStream();
    final ExecResult res = project.exec(new Action<ExecSpec>() {
        @Override
        public void execute(final ExecSpec execSpec) {
            execSpec.setWorkingDir(project.getProjectDir());
            execSpec.commandLine("git", "describe", "--tags", "--long");
            execSpec.setStandardOutput(baos);
        }
    });
    System.out.println(String.format("getGitTagDescriptions:exit '%d'", res.getExitValue()));
    if (res.getExitValue() == 0) {
        final String str = baos.toString().trim();
        if (str == null || str.length() == 0) {
            return "1.0.0";
        } else {
            final String[] arr = str.split("-");
            // [0] - fullVersionTag
            // [1] - versionBuild
            // [2] - gitSHA
            System.out.println(String.format("getGitTagDescriptions '%s' {fullVersion=%s}", str, arr[0]));
            return arr[0];
        }
    } else {
        return "1.0.0";
    }
}
 
开发者ID:mitchwongho,项目名称:appversion-plugin,代码行数:28,代码来源:AppVersionPlugin.java


示例8: zipAlign

import org.gradle.process.ExecSpec; //导入依赖的package包/类
@TaskAction
public void zipAlign() {
    getProject().exec(new Action<ExecSpec>() {
        @Override
        public void execute(ExecSpec execSpec) {
            execSpec.executable(getZipAlignExe());
            execSpec.args("-f", "4");
            execSpec.args(getInputFile());
            execSpec.args(getOutputFile());
        }
    });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ZipAlign.java


示例9: ExecSpecBackedArgCollector

import org.gradle.process.ExecSpec; //导入依赖的package包/类
public ExecSpecBackedArgCollector(ExecSpec action) {
    this.action = action;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:ExecSpecBackedArgCollector.java


示例10: contributeCommandLineOptions

import org.gradle.process.ExecSpec; //导入依赖的package包/类
@Override
public void contributeCommandLineOptions(ExecSpec execHandleBuilder) {
    execHandleBuilder
        .args(GUtil.prefix("-J", jFlags)) // J flags can not be set in the option file
        .args(GUtil.prefix("@", GFileUtils.toPaths(optionFiles))); // add additional option files
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:7,代码来源:CoreJavadocOptions.java


示例11: exec

import org.gradle.process.ExecSpec; //导入依赖的package包/类
public ExecResult exec(Action<? super ExecSpec> action) {
    return getProcessOperations().exec(action);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:DefaultProject.java


示例12: exec

import org.gradle.process.ExecSpec; //导入依赖的package包/类
public ExecResult exec(Action<? super ExecSpec> action) {
    ExecAction execAction = instantiator.newInstance(DefaultExecAction.class, fileResolver);
    action.execute(execAction);
    return execAction.execute();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:6,代码来源:DefaultFileOperations.java


示例13: exec

import org.gradle.process.ExecSpec; //导入依赖的package包/类
@Override
public ExecResult exec(Action<? super ExecSpec> action) {
    return processOperations.exec(action);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:DefaultScript.java


示例14: apply

import org.gradle.process.ExecSpec; //导入依赖的package包/类
@Override
public void apply(Project project) {
  project.getPlugins().apply(NodePlugin.class);

  YarnTask initTask = project.getTasks().create("init", YarnTask.class);
  initTask.setArgs(ImmutableList.of("init", "--yes", "--private"));
  initTask.finalizedBy(
      project
          .getTasks()
          .create(
              "initAddDependency",
              YarnTask.class,
              task -> {
                task.setArgs(ImmutableList.of("add", "@curiostack/cloudbuild-github"));
                task.onlyIf(t -> !project.file("package.json").exists());
              }),
      "yarn");
  initTask.onlyIf(t -> !project.file("package.json").exists());

  ImmutableGcloudExtension gcloudConfig =
      project.getRootProject().getExtensions().getByType(GcloudExtension.class);
  Map<String, String> defaultEnvironment =
      ImmutableMap.of("GCLOUD_PROJECT", gcloudConfig.clusterProject());

  YarnTask setupTask = project.getTasks().create("setup", YarnTask.class);
  setupTask.setArgs(ImmutableList.of("run", "cloudbuild-cli", "setup", "--defaults"));
  setupTask.dependsOn(initTask);
  setupTask.onlyIf(t -> !project.file("config.yml").exists());
  setupTask.setExecOverrides(
      LambdaClosure.of(
          ((ExecSpec exec) -> exec.setStandardInput(System.in).setStandardOutput(System.out))));
  setupTask.setEnvironment(defaultEnvironment);

  Map<String, String> environment =
      gcloudConfig.download()
          ? ImmutableMap.<String, String>builder()
              .put(
                  "PATH",
                  gcloudConfig.platformConfig().gcloudBinDir()
                      + File.pathSeparator
                      + System.getenv("PATH"))
              .putAll(defaultEnvironment)
              .build()
          : defaultEnvironment;

  YarnTask deployTask = project.getTasks().create("deploy", YarnTask.class);
  deployTask.setArgs(ImmutableList.of("run", "cloudbuild-cli", "deploy", "--delete"));
  deployTask.dependsOn(setupTask);
  deployTask.setEnvironment(environment);
  deployTask.dependsOn(":gcloudSetup");
}
 
开发者ID:curioswitch,项目名称:curiostack,代码行数:52,代码来源:CloudbuildGithubPlugin.java


示例15: getSetupAction

import org.gradle.process.ExecSpec; //导入依赖的package包/类
/**
 * The action that configures the execution of command line
 */
public Action<ExecSpec> getSetupAction() {
    return setupAction;
}
 
开发者ID:mockito,项目名称:shipkit,代码行数:7,代码来源:ExecCommand.java


示例16: contributeCommandLineOptions

import org.gradle.process.ExecSpec; //导入依赖的package包/类
public void contributeCommandLineOptions(ExecSpec execHandleBuilder) {
    execHandleBuilder
        .args(GUtil.prefix("-J", jFlags)) // J flags can not be set in the option file
        .args(GUtil.prefix("@", GFileUtils.toPaths(optionFiles))); // add additional option files
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:6,代码来源:CoreJavadocOptions.java


示例17: exec

import org.gradle.process.ExecSpec; //导入依赖的package包/类
public ExecResult exec(Closure closure) {
    return exec(new ClosureBackedAction<ExecSpec>(closure));
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:4,代码来源:AbstractProject.java


示例18: exec

import org.gradle.process.ExecSpec; //导入依赖的package包/类
public ExecResult exec(Closure closure) {
    return processOperations.exec(new ClosureBackedAction<ExecSpec>(closure));
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:4,代码来源:DefaultScript.java


示例19: commandLine

import org.gradle.process.ExecSpec; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public ExecSpec commandLine(Iterable<?> args) {
    execAction.commandLine(args);
    return this;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:8,代码来源:Exec.java


示例20: setIgnoreExitValue

import org.gradle.process.ExecSpec; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public ExecSpec setIgnoreExitValue(boolean ignoreExitValue) {
    execAction.setIgnoreExitValue(ignoreExitValue);
    return this;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:8,代码来源:Exec.java



注:本文中的org.gradle.process.ExecSpec类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JsonFlattener类代码示例发布时间:2022-05-22
下一篇:
Java Option类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap