-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix - Support composite builds using build actions (#154)
Co-authored-by: Arthur McGibbon <arthur.mcgibbon@h3im.com>
- Loading branch information
1 parent
544fc2b
commit 5af4df6
Showing
25 changed files
with
438 additions
and
99 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
45 changes: 45 additions & 0 deletions
45
model/src/main/java/com/microsoft/java/bs/gradle/model/GradleSourceSetsMetadata.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,45 @@ | ||
package com.microsoft.java.bs.gradle.model; | ||
|
||
import java.io.File; | ||
import java.io.Serializable; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* Provides necessary information about Gradle source sets, | ||
* enabling mapping of dependencies between them. | ||
*/ | ||
public interface GradleSourceSetsMetadata extends Serializable { | ||
|
||
/** | ||
* Returns a map that associates each Gradle source set with its corresponding | ||
* classpath files in a gradle project. This typically includes any libraries | ||
* or dependencies required for compilation within that source set. | ||
* | ||
* <p> | ||
* The keys of the map represent instances of the {@link GradleSourceSet} class, | ||
* identifying all the source sets within the project. | ||
* </p> | ||
* <p> | ||
* The values of the map are lists of {@link File} objects, representing the | ||
* classpath files associated with the corresponding source set. | ||
* </p> | ||
*/ | ||
Map<GradleSourceSet, List<File>> getGradleSourceSetsToClasspath(); | ||
|
||
/** | ||
* Returns a map that associates output files with the Gradle source sets that | ||
* generated them. This is useful for understanding the origin of generated artifacts. | ||
* | ||
* <p> | ||
* The keys of the map are {@link File} objects, representing individual | ||
* output files produced during the build process. | ||
* </p> | ||
* <p> | ||
* The values of the map are instances of the {@link GradleSourceSet} class, | ||
* indicating the source set that generated the corresponding output file. | ||
* </p> | ||
*/ | ||
Map<File, GradleSourceSet> getOutputsToSourceSet(); | ||
|
||
} |
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
62 changes: 62 additions & 0 deletions
62
...rc/main/java/com/microsoft/java/bs/gradle/model/impl/DefaultGradleSourceSetsMetadata.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,62 @@ | ||
package com.microsoft.java.bs.gradle.model.impl; | ||
|
||
import com.microsoft.java.bs.gradle.model.GradleSourceSet; | ||
import com.microsoft.java.bs.gradle.model.GradleSourceSetsMetadata; | ||
|
||
import java.io.File; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
/** | ||
* Default implementation of {@link DefaultGradleSourceSetsMetadata}. | ||
*/ | ||
public class DefaultGradleSourceSetsMetadata implements GradleSourceSetsMetadata { | ||
|
||
private Map<GradleSourceSet, List<File>> sourceSetsToClasspath; | ||
private Map<File, GradleSourceSet> outputsToSourceSet; | ||
|
||
public DefaultGradleSourceSetsMetadata( | ||
Map<GradleSourceSet, List<File>> sourceSetsToClasspath, | ||
Map<File, GradleSourceSet> outputsToSourceSet | ||
) { | ||
this.sourceSetsToClasspath = sourceSetsToClasspath; | ||
this.outputsToSourceSet = outputsToSourceSet; | ||
} | ||
|
||
@Override | ||
public Map<GradleSourceSet, List<File>> getGradleSourceSetsToClasspath() { | ||
return sourceSetsToClasspath; | ||
} | ||
|
||
public void setSourceSetsToClasspath(Map<GradleSourceSet, List<File>> sourceSetsToClasspath) { | ||
this.sourceSetsToClasspath = sourceSetsToClasspath; | ||
} | ||
|
||
@Override | ||
public Map<File, GradleSourceSet> getOutputsToSourceSet() { | ||
return outputsToSourceSet; | ||
} | ||
|
||
public void setOutputsToSourceSet(Map<File, GradleSourceSet> outputsToSourceSet) { | ||
this.outputsToSourceSet = outputsToSourceSet; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(sourceSetsToClasspath, outputsToSourceSet); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) { | ||
return true; | ||
} | ||
if (obj == null || getClass() != obj.getClass()) { | ||
return false; | ||
} | ||
DefaultGradleSourceSetsMetadata that = (DefaultGradleSourceSetsMetadata) obj; | ||
return Objects.equals(sourceSetsToClasspath, that.sourceSetsToClasspath) | ||
&& Objects.equals(outputsToSourceSet, that.outputsToSourceSet); | ||
} | ||
} |
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
Oops, something went wrong.