Search in sources :

Example 1 with FileReference

use of org.gradle.plugins.ide.eclipse.model.FileReference in project gradle by gradle.

the class WtpComponentFactory method createWbDependentModuleEntry.

private WbDependentModule createWbDependentModuleEntry(File file, FileReferenceFactory fileReferenceFactory, String deployPath) {
    FileReference ref = fileReferenceFactory.fromFile(file);
    String handleSnippet = ref.isRelativeToPathVariable() ? "var/" + ref.getPath() : "lib/" + ref.getPath();
    return new WbDependentModule(deployPath, "module:/classpath/" + handleSnippet);
}
Also used : FileReference(org.gradle.plugins.ide.eclipse.model.FileReference) WbDependentModule(org.gradle.plugins.ide.eclipse.model.WbDependentModule)

Example 2 with FileReference

use of org.gradle.plugins.ide.eclipse.model.FileReference in project gradle by gradle.

the class EclipseDependenciesCreator method createLibraryEntry.

private static AbstractLibrary createLibraryEntry(File binary, File source, File javadoc, EclipseClasspath classpath, ModuleVersionIdentifier id) {
    FileReferenceFactory referenceFactory = classpath.getFileReferenceFactory();
    FileReference binaryRef = referenceFactory.fromFile(binary);
    FileReference sourceRef = referenceFactory.fromFile(source);
    FileReference javadocRef = referenceFactory.fromFile(javadoc);
    final AbstractLibrary out = binaryRef.isRelativeToPathVariable() ? new Variable(binaryRef) : new Library(binaryRef);
    out.setJavadocPath(javadocRef);
    out.setSourcePath(sourceRef);
    out.setExported(false);
    out.setModuleVersion(id);
    return out;
}
Also used : Variable(org.gradle.plugins.ide.eclipse.model.Variable) AbstractLibrary(org.gradle.plugins.ide.eclipse.model.AbstractLibrary) Library(org.gradle.plugins.ide.eclipse.model.Library) AbstractLibrary(org.gradle.plugins.ide.eclipse.model.AbstractLibrary) FileReference(org.gradle.plugins.ide.eclipse.model.FileReference)

Aggregations

FileReference (org.gradle.plugins.ide.eclipse.model.FileReference)2 AbstractLibrary (org.gradle.plugins.ide.eclipse.model.AbstractLibrary)1 Library (org.gradle.plugins.ide.eclipse.model.Library)1 Variable (org.gradle.plugins.ide.eclipse.model.Variable)1 WbDependentModule (org.gradle.plugins.ide.eclipse.model.WbDependentModule)1