All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.wisepersist.gradle.plugins.gwt.GwtCompile Maven / Gradle / Ivy

There is a newer version: 1.1.19
Show newest version
/**
 * Copyright (C) 2013-2017 Steffen Schaefer
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.wisepersist.gradle.plugins.gwt;

import java.io.File;
import java.util.concurrent.Callable;
import org.gradle.api.internal.ConventionMapping;
import org.gradle.api.internal.IConventionAware;
import org.gradle.api.tasks.CacheableTask;
import org.gradle.api.tasks.OutputDirectory;

/**
 * Task to run the GWT compiler for production quality output.
 */
@CacheableTask
public class GwtCompile extends AbstractGwtCompile {

  /** {@inheritDoc} */
  @Override
  @OutputDirectory
  public File getWar() {
    return super.getWar();
  }

  /** {@inheritDoc} */
  @Override
  protected boolean isDevTask() {
    return false;
  }

  @Override
  protected void configure(final GwtCompileOptions options) {
    super.configure(options);

    ConventionMapping conventionMapping = ((IConventionAware) this)
        .getConventionMapping();
    conventionMapping.map("draftCompile",
        (Callable) () -> options.getDraftCompile());
    conventionMapping.map("compileReport",
        (Callable) () -> options.getCompileReport());
    conventionMapping.map("compilerMetrics",
        (Callable) () -> options.getCompilerMetrics());
    conventionMapping.map("validateOnly",
        (Callable) () -> options.getValidateOnly());
    conventionMapping.map("disableGeneratingOnShards",
        (Callable) () -> options.getDisableGeneratingOnShards());
    conventionMapping.map("optimize",
        (Callable) () -> options.getOptimize());
    conventionMapping.map("disableAggressiveOptimization",
        (Callable) () -> options.getDisableAggressiveOptimization());
    conventionMapping.map("disableClassMetadata",
        (Callable) () -> options.getDisableClassMetadata());
    conventionMapping.map("disableCastChecking",
        (Callable) () -> options.getDisableCastChecking());
    conventionMapping.map("ea", (Callable) () -> options.getEa());
    conventionMapping.map("disableRunAsync",
        (Callable) () -> options.getDisableRunAsync());
    conventionMapping.map("style", (Callable