org.gradle.api.Project.getExtensions()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(352)

本文整理了Java中org.gradle.api.Project.getExtensions()方法的一些代码示例,展示了Project.getExtensions()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.getExtensions()方法的具体详情如下:
包路径:org.gradle.api.Project
类名称:Project
方法名:getExtensions

Project.getExtensions介绍

暂无

代码示例

代码示例来源:origin: alipay/sofa-boot

private void createExtension(Project project) {
  project.getExtensions().create("springBoot", SpringBootExtension.class, project);
}

代码示例来源:origin: alipay/sofa-boot

@SuppressWarnings("NullableProblems")
  @Override
  public void execute(Project project) {
    Objects.requireNonNull(project.getExtensions().findByType(DependencyManagementExtension.class))
        .imports((importsHandler) -> importsHandler
            .mavenBom(SofaBootPlugin.BOM_COORDINATES));
  }
}

代码示例来源:origin: uber/okbuck

public static OkBuckExtension getOkBuckExtension(Project project) {
 return (OkBuckExtension)
   project.getRootProject().getExtensions().getByName(OkBuckGradlePlugin.OKBUCK);
}

代码示例来源:origin: ManbangGroup/Phantom

CompileDependenciesFileGenerator(Project project, ApplicationVariantImpl variant, File outputFileDir,
    String outputFileName) {
  super(outputFileDir, outputFileName);
  this.project = project;
  this.applicationVariant = variant;
  this.agpVersion = (ComparableVersion) project.getExtensions().getExtraProperties().get(Constant.AGP_VERSION);
}

代码示例来源:origin: uber/okbuck

public BaseExtension getAndroidExtension() {
 return (BaseExtension) getProject().getExtensions().getByName("android");
}

代码示例来源:origin: uber/okbuck

public static void initScopeCache(Project project) {
 project
   .getExtensions()
   .getExtraProperties()
   .set(getCacheKey(project, SCOPE_CACHE), new ConcurrentHashMap<>());
}

代码示例来源:origin: meituan/WMRouter

@Override
  public void apply(Project project) {
    WMRouterExtension extension = project.getExtensions()
        .create(Const.NAME, WMRouterExtension.class);

    WMRouterLogger.info("register transform");
    project.getExtensions().findByType(BaseExtension.class)
        .registerTransform(new WMRouterTransform());

    project.afterEvaluate(p -> WMRouterLogger.setConfig(extension));
  }
}

代码示例来源:origin: uber/okbuck

public static void resetScopeCache(Project project) {
 project.getExtensions().getExtraProperties().set(getCacheKey(project, SCOPE_CACHE), null);
}

代码示例来源:origin: uber/okbuck

private static void resetTargetCache(Project project) {
 project.getExtensions().getExtraProperties().set(getCacheKey(project, TARGET_CACHE), null);
}

代码示例来源:origin: uber/okbuck

private static void initTargetCache(Project project) {
 project
   .getExtensions()
   .getExtraProperties()
   .set(getCacheKey(project, TARGET_CACHE), new TargetCache(project));
}

代码示例来源:origin: f2prateek/dart

public HensonManager(Project project) {
 this.project = project;
 this.logger = project.getLogger();
 this.taskManager = new TaskManager(project, logger);
 this.dependencyManager = new DependencyManager(project, logger);
 this.hensonExtension = (HensonPluginExtension) project.getExtensions().getByName("henson");
}

代码示例来源:origin: uber/okbuck

targets =
  project
    .getExtensions()
    .getByType(AppExtension.class)
    .getApplicationVariants()
targets =
  project
    .getExtensions()
    .getByType(LibraryExtension.class)
    .getLibraryVariants()

代码示例来源:origin: hibernate/hibernate-orm

public void apply(Project project) {
  project.getPlugins().apply( "java" );
  final HibernateExtension hibernateExtension = new HibernateExtension( project );
  project.getLogger().debug( "Adding Hibernate extensions to the build [{}]", project.getName() );
  project.getExtensions().add( "hibernate", hibernateExtension );
  project.afterEvaluate(
      new Action<Project>() {
        @Override
        public void execute(Project project) {
          if ( hibernateExtension.enhance != null ) {
            applyEnhancement( project, hibernateExtension );
          }
        }
      }
  );
}

代码示例来源:origin: uber/okbuck

rootProject.getExtensions().create(OKBUCK, OkBuckExtension.class, rootProject);

代码示例来源:origin: uber/okbuck

try {
 AndroidExtensionsExtension androidExtensions =
   project.getExtensions().getByType(AndroidExtensionsExtension.class);
 hasKotlinExtension = hasKotlinAndroidExtensions && androidExtensions.isExperimental();
} catch (Exception ignored) {

代码示例来源:origin: diffplug/spotless

@Override
public void apply(Project project) {
  // make sure there's a `clean` task
  project.getPlugins().apply(BasePlugin.class);
  // setup the extension
  spotlessExtension = project.getExtensions().create(EXTENSION, SpotlessExtension.class, project);
  // after the project has been evaluated, configure the check and format tasks per source set
  project.afterEvaluate(this::createTasks);
}

代码示例来源:origin: lenskit/lenskit

public void apply(Project project) {
  final LenskitExtension lenskit = project.getExtensions().create("lenskit", LenskitExtension.class, project);

代码示例来源:origin: linkedin/pygradle

public PythonExtension getPythonExtension() {
  if (null == extension) {
    extension = getProject().getExtensions().getByType(PythonExtension.class);
  }
  return extension;
}

代码示例来源:origin: purplejs/purplejs

@Override
public void apply( final Project project )
{
  this.project = project;
  this.ext = this.project.getExtensions().create( "purplejs", PurpleExtension.class, this.project );
  addPlugins();
  addRepositories();
  addDependencies();
  configureAppPlugin();
}

代码示例来源:origin: spring-gradle-plugins/dependency-management-plugin

@Override
public void apply(final Project project) {
  InternalComponents internalComponents = new InternalComponents(project);
  final DependencyManagementExtension dependencyManagementExtension =
      internalComponents.getDependencyManagementExtension();
  project.getExtensions().add("dependencyManagement", dependencyManagementExtension);
  internalComponents.createDependencyManagementReportTask("dependencyManagement");
  project.getConfigurations().all(internalComponents.getImplicitDependencyManagementCollector());
  project.getConfigurations().all(internalComponents.getDependencyManagementApplier());
  configurePomCustomization(project, dependencyManagementExtension);
}

相关文章