-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add header only version of chipobject
- Loading branch information
Showing
5 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/main/java/edu/wpi/first/nativeutils/dependencies/WPIHeaderOnlyMavenDependency.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package edu.wpi.first.nativeutils.dependencies; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.gradle.api.Project; | ||
import org.gradle.api.file.FileCollection; | ||
import org.gradle.api.provider.Property; | ||
import org.gradle.nativeplatform.NativeBinarySpec; | ||
|
||
public abstract class WPIHeaderOnlyMavenDependency extends WPIMavenDependency { | ||
@Inject | ||
public WPIHeaderOnlyMavenDependency(String name, Project project) { | ||
super(name, project); | ||
} | ||
|
||
private final Map<NativeBinarySpec, ResolvedNativeDependency> resolvedDependencies = new HashMap<>(); | ||
|
||
@Override | ||
public ResolvedNativeDependency resolveNativeDependency(NativeBinarySpec binary, FastDownloadDependencySet loaderDependencySet) { | ||
ResolvedNativeDependency resolvedDep = resolvedDependencies.get(binary); | ||
if (resolvedDep != null) { | ||
return resolvedDep; | ||
} | ||
|
||
FileCollection headers = getArtifactRoots(getHeaderClassifier().getOrElse(null), ArtifactType.HEADERS, loaderDependencySet); | ||
|
||
FileCollection sources = getProject().files(); | ||
FileCollection linkFiles = getProject().files(); | ||
FileCollection runtimeFiles = getProject().files(); | ||
|
||
resolvedDep = new ResolvedNativeDependency(headers, sources, linkFiles, runtimeFiles); | ||
|
||
resolvedDependencies.put(binary, resolvedDep); | ||
return resolvedDep; | ||
} | ||
|
||
public abstract Property<Boolean> getSkipAtRuntime(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters