本文整理汇总了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;
}
示例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);
}
示例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());
}
示例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;
}
示例5: getScope
import org.gradle.tooling.model.idea.IdeaDependencyScope; //导入依赖的package包/类
public IdeaDependencyScope getScope() {
return scope;
}
示例6: setScope
import org.gradle.tooling.model.idea.IdeaDependencyScope; //导入依赖的package包/类
public DefaultIdeaModuleDependency setScope(IdeaDependencyScope scope) {
this.scope = scope;
return this;
}
示例7: setScope
import org.gradle.tooling.model.idea.IdeaDependencyScope; //导入依赖的package包/类
public DefaultIdeaSingleEntryLibraryDependency setScope(IdeaDependencyScope scope) {
this.scope = scope;
return this;
}
示例8: getScope
import org.gradle.tooling.model.idea.IdeaDependencyScope; //导入依赖的package包/类
@Override
public IdeaDependencyScope getScope() {
return IdeaDependencyScopeStub.COMPILE;
}