Examples of JavaPluginConvention


Examples of org.gradle.api.plugins.JavaPluginConvention

    void initExtensionDefaults(Project project)
    {
        outfile = project.getName()+".exe";
        version = (String)project.getVersion();
       
        JavaPluginConvention javaConv = (JavaPluginConvention)project.getConvention().getPlugins().get("java");
        if (javaConv != null)
        {
            jreMinVersion = javaConv.getTargetCompatibility().toString();
            if (JAVA_VERSION_REGEX.matcher(jreMinVersion).matches())
            {
                jreMinVersion = jreMinVersion + ".0";
            }
        }
View Full Code Here

Examples of org.gradle.api.plugins.JavaPluginConvention

        binDeobf.addTransformer(extAts);
        decompDeobf.addTransformer(extAts);

        // from the resources dirs
        {
            JavaPluginConvention javaConv = (JavaPluginConvention) project.getConvention().getPlugins().get("java");

            SourceSet main = javaConv.getSourceSets().getByName("main");
            SourceSet api = javaConv.getSourceSets().getByName("api");

            for (File at : main.getResources().getFiles())
            {
                if (at.getName().toLowerCase().endsWith("_at.cfg"))
                {
View Full Code Here

Examples of org.gradle.api.plugins.JavaPluginConvention

    @SuppressWarnings("rawtypes")
    protected void configurePackaging()
    {
        String cappedApiName = Character.toUpperCase(actualApiName().charAt(0)) + actualApiName().substring(1);
        JavaPluginConvention javaConv = (JavaPluginConvention) project.getConvention().getPlugins().get("java");

        // create apiJar task
        Jar jarTask = makeTask("jar" + cappedApiName, Jar.class);
        jarTask.from(javaConv.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME).getOutput());
        jarTask.setClassifier(actualApiName());
        jarTask.setExtension(getJarExtension());

        // configure otherPlugin task to have a classifier
        ((Jar) project.getTasks().getByName("jar")).setClassifier(((UserBasePlugin) otherPlugin).getApiName());

        //  configure reobf for litemod
        ((ReobfTask) project.getTasks().getByName("reobf")).reobf(jarTask, new Action<ArtifactSpec>()
        {
            @Override
            public void execute(ArtifactSpec spec)
            {
                spec.setSrgMcp();

                JavaPluginConvention javaConv = (JavaPluginConvention) project.getConvention().getPlugins().get("java");
                spec.setClasspath(javaConv.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME).getCompileClasspath());
            }

        });

        project.getArtifacts().add("archives", jarTask);
View Full Code Here

Examples of org.gradle.api.plugins.JavaPluginConvention

     * This mod adds the API sourceSet, and correctly configures the
     */
    protected void configureCompilation()
    {
        // get conventions
        JavaPluginConvention javaConv = (JavaPluginConvention) project.getConvention().getPlugins().get("java");

        SourceSet main = javaConv.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME);
        SourceSet test = javaConv.getSourceSets().getByName(SourceSet.TEST_SOURCE_SET_NAME);
        SourceSet api = javaConv.getSourceSets().create("api");

        // set the Source
        javaConv.setSourceCompatibility("1.6");
        javaConv.setTargetCompatibility("1.6");

        main.setCompileClasspath(main.getCompileClasspath().plus(api.getOutput()));
        test.setCompileClasspath(test.getCompileClasspath().plus(api.getOutput()));

        project.getConfigurations().getByName("apiCompile").extendsFrom(project.getConfigurations().getByName("compile"));
View Full Code Here

Examples of org.gradle.api.plugins.JavaPluginConvention

            task.reobf(project.getTasks().getByName("jar"), new Action<ArtifactSpec>()
            {
                @Override
                public void execute(ArtifactSpec arg0)
                {
                    JavaPluginConvention javaConv = (JavaPluginConvention) project.getConvention().getPlugins().get("java");
                    arg0.setClasspath(javaConv.getSourceSets().getByName("main").getCompileClasspath());
                }

            });
           
            task.mustRunAfter("test");
View Full Code Here

Examples of org.gradle.api.plugins.JavaPluginConvention

        }
    }
   
    private final void createSourceCopyTasks()
    {
        JavaPluginConvention javaConv = (JavaPluginConvention) project.getConvention().getPlugins().get("java");
        SourceSet main = javaConv.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME);

        // do the special source moving...
        SourceCopyTask task;

        // main
View Full Code Here

Examples of org.gradle.api.plugins.JavaPluginConvention

    project.getPlugins().apply(RebelPlugin.class);
       
    callAfterEvaluated(project);
   
    // Create the default classes directory by hand, as the Java plugin is not actually executing in our test
    JavaPluginConvention javaConvention = project.getConvention().getPlugin(JavaPluginConvention.class);
    File defaultClassesDir = javaConvention.getSourceSets().getByName("main").getOutput().getClassesDir();
    defaultClassesDir.mkdirs();
   
    log.info("defaultClassesDir: " + defaultClassesDir.getAbsolutePath());
   
    // Create the default resources directory by hand
    File defaultResourcesDir = javaConvention.getSourceSets().getByName("main").getOutput().getResourcesDir();
    defaultResourcesDir.mkdirs();
   
    log.info("defaultResourcesDir: " + defaultResourcesDir.getAbsolutePath());
   
    // Get and execute the rebel task
View Full Code Here

Examples of org.gradle.api.plugins.JavaPluginConvention

    project.getPlugins().apply(RebelPlugin.class);
       
    callAfterEvaluated(project);
   
    // Default classes directory 
    JavaPluginConvention javaConvention = project.getConvention().getPlugin(JavaPluginConvention.class);
    File defaultClassesDir = javaConvention.getSourceSets().getByName("main").getOutput().getClassesDir();
    // create directory by hand, as the Java plugin is not actually executing in our test
    defaultClassesDir.mkdirs();
    log.info("Default classes dir: " + defaultClassesDir.getAbsolutePath());
   
    // Default resources directory
    File defaultResourcesDir = javaConvention.getSourceSets().getByName("main").getOutput().getResourcesDir();
    // create directory by hand, as the Java plugin is not actually executing in our test
    defaultResourcesDir.mkdirs();
    log.info("Default resources dir: " + defaultResourcesDir.getAbsolutePath());

    // Default webapp directory
View Full Code Here

Examples of org.gradle.api.plugins.JavaPluginConvention

      public Object call() throws Exception {
        if (rebelExtension.getRebelXmlDirectory() != null) {
          return new File(rebelExtension.getRebelXmlDirectory());
        }
        else {
          JavaPluginConvention javaConvention = project.getConvention().getPlugin(JavaPluginConvention.class);
          return javaConvention.getSourceSets().getByName("main").getOutput().getClassesDir();
        }
      }
    });
  }
View Full Code Here

Examples of org.gradle.api.plugins.JavaPluginConvention

   */
  private void configureDefaultClassesDirectory(final Project project, final IConventionAware conventionAwareRebelTask) {
    conventionAwareRebelTask.getConventionMapping().map(RebelGenerateTask.NAME_DEFAULT_CLASSES_DIRECTORY, new Callable<Object>() {
      public Object call() {
        try {
          JavaPluginConvention javaConvention = project.getConvention().getPlugin(JavaPluginConvention.class);
          return javaConvention.getSourceSets().getByName("main").getOutput().getClassesDir();
        }
        catch (Exception e) {
          return null;
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.