当前位置: 首页>>代码示例>>Java>>正文


Java IdeaDependencyScope类代码示例

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


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

示例1: copy

import org.gradle.tooling.model.idea.IdeaDependencyScope; //导入依赖的package包/类
@Nullable
public static JarLibraryDependency copy(@NotNull IdeaSingleEntryLibraryDependency original) {
  File binaryPath = original.getFile();
  if (binaryPath != null) {
    String scope = null;
    IdeaDependencyScope originalScope = original.getScope();
    if (originalScope != null) {
      scope = originalScope.getScope();
    }
    boolean resolved = isResolved(original);
    String name;
    if (resolved) {
      // Gradle API doesn't provide library name at the moment.
      name = binaryPath.isFile() ? getNameWithoutExtension(binaryPath) : sanitizeFileName(binaryPath.getPath());
    }
    else {
      name = getUnresolvedDependencyName(original);
      if (name == null) {
        return null;
      }
    }
    return new JarLibraryDependency(name, binaryPath, original.getSource(), original.getJavadoc(), scope, resolved);
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:JarLibraryDependency.java

示例2: testCopy

import org.gradle.tooling.model.idea.IdeaDependencyScope; //导入依赖的package包/类
@Test
public void testCopy() {
  String moduleName = "lib";
  IdeaDependencyScope scope = createMock(IdeaDependencyScope.class);

  expect(myOriginalDependency.getDependencyModule()).andStubReturn(myIdeaModule);
  expect(myIdeaModule.getName()).andStubReturn(moduleName);
  expect(myOriginalDependency.getScope()).andStubReturn(scope);
  expect(myOriginalDependency.getExported()).andStubReturn(true);
  expect(scope.getScope()).andStubReturn("compile");

  replay(myOriginalDependency, myIdeaModule, scope);

  JavaModuleDependency copy = JavaModuleDependency.copy(myOriginalDependency);
  assertNotNull(copy);
  assertEquals(moduleName, copy.getModuleName());
  assertSame("compile", copy.getScope());
  assertTrue(copy.isExported());

  verify(myOriginalDependency, myIdeaModule, scope);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:JavaModuleDependencyTest.java

示例3: testCopyWithResolvedDependency

import org.gradle.tooling.model.idea.IdeaDependencyScope; //导入依赖的package包/类
@Test
public void testCopyWithResolvedDependency() {
  FileStub binaryPath = new FileStub("fake.jar", true);
  FileStub sourcePath = new FileStub("fake-src.jar", true);
  FileStub javadocPath = new FileStub("fake-javadoc.jar", true);

  IdeaDependencyScope scope = createMock(IdeaDependencyScope.class);

  expect(myOriginalDependency.getFile()).andStubReturn(binaryPath);
  expect(myOriginalDependency.getSource()).andStubReturn(sourcePath);
  expect(myOriginalDependency.getJavadoc()).andStubReturn(javadocPath);
  expect(myOriginalDependency.getScope()).andStubReturn(scope);
  expect(scope.getScope()).andStubReturn("compile");
  replay(myOriginalDependency, scope);

  JarLibraryDependency dependency = JarLibraryDependency.copy(myOriginalDependency);
  assertNotNull(dependency);
  assertEquals("fake", dependency.getName());
  assertEquals("compile", dependency.getScope());
  assertSame(binaryPath, dependency.getBinaryPath());
  assertSame(sourcePath, dependency.getSourcePath());
  assertSame(javadocPath, dependency.getJavadocPath());
  assertTrue(dependency.isResolved());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:JarLibraryDependencyTest.java

示例4: copy

import org.gradle.tooling.model.idea.IdeaDependencyScope; //导入依赖的package包/类
@Nullable
public static JavaModuleDependency copy(IdeaModuleDependency original) {
  IdeaModule module = original.getDependencyModule();
  if (module != null && isNotEmpty(module.getName())) {
    String scope = null;
    IdeaDependencyScope originalScope = original.getScope();
    if (originalScope != null) {
      scope = originalScope.getScope();
    }
    return new JavaModuleDependency(module.getName(), scope, original.getExported());
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:JavaModuleDependency.java

示例5: getScope

import org.gradle.tooling.model.idea.IdeaDependencyScope; //导入依赖的package包/类
public IdeaDependencyScope getScope() {
    return scope;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:DefaultIdeaModuleDependency.java

示例6: setScope

import org.gradle.tooling.model.idea.IdeaDependencyScope; //导入依赖的package包/类
public DefaultIdeaModuleDependency setScope(IdeaDependencyScope scope) {
    this.scope = scope;
    return this;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:DefaultIdeaModuleDependency.java

示例7: setScope

import org.gradle.tooling.model.idea.IdeaDependencyScope; //导入依赖的package包/类
public DefaultIdeaSingleEntryLibraryDependency setScope(IdeaDependencyScope scope) {
    this.scope = scope;
    return this;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:DefaultIdeaSingleEntryLibraryDependency.java

示例8: getScope

import org.gradle.tooling.model.idea.IdeaDependencyScope; //导入依赖的package包/类
@Override
public IdeaDependencyScope getScope() {
  return IdeaDependencyScopeStub.COMPILE;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:IdeaSingleEntryLibraryDependencyStub.java


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