-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle different project dependency configs
- Loading branch information
Arthur McGibbon
committed
Dec 18, 2023
1 parent
b77ecfd
commit 29668f6
Showing
43 changed files
with
425 additions
and
126 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
77 changes: 77 additions & 0 deletions
77
...l/src/main/java/com/microsoft/java/bs/gradle/model/impl/DefaultBuildTargetDependency.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,77 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
package com.microsoft.java.bs.gradle.model.impl; | ||
|
||
import java.util.Objects; | ||
|
||
import com.microsoft.java.bs.gradle.model.BuildTargetDependency; | ||
import com.microsoft.java.bs.gradle.model.GradleSourceSet; | ||
|
||
/** | ||
* Default implementation of {@link BuildTargetDependency}. | ||
*/ | ||
public class DefaultBuildTargetDependency implements BuildTargetDependency { | ||
private static final long serialVersionUID = 1L; | ||
|
||
private String projectPath; | ||
|
||
private String sourceSetName; | ||
|
||
public DefaultBuildTargetDependency(String projectPath, String sourceSetName) { | ||
this.projectPath = projectPath; | ||
this.sourceSetName = sourceSetName; | ||
} | ||
|
||
public DefaultBuildTargetDependency(GradleSourceSet sourceSet) { | ||
this(sourceSet.getProjectPath(), sourceSet.getSourceSetName()); | ||
} | ||
|
||
|
||
/** | ||
* Copy constructor. | ||
* | ||
* @param buildTargetDependency the other instance to copy from. | ||
*/ | ||
public DefaultBuildTargetDependency(BuildTargetDependency buildTargetDependency) { | ||
this.projectPath = buildTargetDependency.getProjectPath(); | ||
this.sourceSetName = buildTargetDependency.getSourceSetName(); | ||
} | ||
|
||
public String getProjectPath() { | ||
return projectPath; | ||
} | ||
|
||
public void setProjectPath(String projectPath) { | ||
this.projectPath = projectPath; | ||
} | ||
|
||
public String getSourceSetName() { | ||
return sourceSetName; | ||
} | ||
|
||
public void setSourceSetName(String sourceSetName) { | ||
this.sourceSetName = sourceSetName; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(projectPath, sourceSetName); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) { | ||
return true; | ||
} | ||
if (obj == null) { | ||
return false; | ||
} | ||
if (getClass() != obj.getClass()) { | ||
return false; | ||
} | ||
DefaultBuildTargetDependency other = (DefaultBuildTargetDependency) obj; | ||
return Objects.equals(projectPath, other.projectPath) | ||
&& Objects.equals(sourceSetName, other.sourceSetName); | ||
} | ||
} |
58 changes: 0 additions & 58 deletions
58
...src/main/java/com/microsoft/java/bs/gradle/model/impl/DefaultGradleProjectDependency.java
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.