4141import org .gradle .api .tasks .SourceSet ;
4242import org .gradle .api .tasks .SourceSetContainer ;
4343import org .gradle .api .tasks .TaskAction ;
44- import org .gradle .util .GradleVersion ;
4544
4645/**
4746 * Prints out changing source dependencies on a project.
@@ -79,9 +78,9 @@ public void listFiles() throws IOException {
7978
8079 // Add extra layer
8180 List <Path > extraDirectories =
82- jibExtension .getExtraDirectories ().getPaths ().stream ()
83- .map (ExtraDirectoryParameters ::getFrom )
84- .collect (Collectors .toList ());
81+ jibExtension .getExtraDirectories ().getPaths ().stream ()
82+ .map (ExtraDirectoryParameters ::getFrom )
83+ .collect (Collectors .toList ());
8584 extraDirectories .stream ().filter (Files ::exists ).forEach (skaffoldFilesOutput ::addInput );
8685
8786 // Find project dependencies
@@ -98,7 +97,7 @@ public void listFiles() throws IOException {
9897 configurationName = "default" ;
9998 }
10099 for (Configuration targetConfiguration :
101- dependentProject .getConfigurations ().getByName (configurationName ).getHierarchy ()) {
100+ dependentProject .getConfigurations ().getByName (configurationName ).getHierarchy ()) {
102101 for (PublishArtifact artifact : targetConfiguration .getArtifacts ()) {
103102 projectDependencyJars .add (artifact .getFile ());
104103 }
@@ -107,7 +106,7 @@ public void listFiles() throws IOException {
107106
108107 // Add SNAPSHOT, non-project dependency jars
109108 for (File file :
110- project .getConfigurations ().getByName (jibExtension .getConfigurationName ().get ())) {
109+ project .getConfigurations ().getByName (jibExtension .getConfigurationName ().get ())) {
111110 if (!projectDependencyJars .contains (file ) && file .toString ().contains ("SNAPSHOT" )) {
112111 skaffoldFilesOutput .addInput (file .toPath ());
113112 projectDependencyJars .add (file ); // Add to set to avoid printing the same files twice
@@ -162,7 +161,7 @@ private void addSettingsFile(Project project, Path projectPath) {
162161 try {
163162 Object startParameter = project .getGradle ().getStartParameter ();
164163 java .lang .reflect .Method getSettingsFileMethod =
165- startParameter .getClass ().getMethod ("getSettingsFile" );
164+ startParameter .getClass ().getMethod ("getSettingsFile" );
166165 File settingsFile = (File ) getSettingsFileMethod .invoke (startParameter );
167166 if (settingsFile != null ) {
168167 skaffoldFilesOutput .addBuild (settingsFile .toPath ());
@@ -189,19 +188,19 @@ private void addProjectFiles(Project project) {
189188
190189 // Add sources + resources
191190 SourceSetContainer sourceSetContainer =
192- project .getExtensions ().findByType (SourceSetContainer .class );
191+ project .getExtensions ().findByType (SourceSetContainer .class );
193192 if (sourceSetContainer != null ) {
194193 SourceSet mainSourceSet = sourceSetContainer .findByName (SourceSet .MAIN_SOURCE_SET_NAME );
195194 if (mainSourceSet != null ) {
196195 mainSourceSet
197- .getAllSource ()
198- .getSourceDirectories ()
199- .forEach (
200- sourceDirectory -> {
201- if (sourceDirectory .exists ()) {
202- skaffoldFilesOutput .addInput (sourceDirectory .toPath ());
203- }
204- });
196+ .getAllSource ()
197+ .getSourceDirectories ()
198+ .forEach (
199+ sourceDirectory -> {
200+ if (sourceDirectory .exists ()) {
201+ skaffoldFilesOutput .addInput (sourceDirectory .toPath ());
202+ }
203+ });
205204 }
206205 }
207206 }
@@ -226,7 +225,7 @@ private Set<ProjectDependency> findProjectDependencies(Project project) {
226225
227226 // Search through all dependencies
228227 Configuration runtimeClasspath =
229- currentProject .getConfigurations ().findByName (configurationName );
228+ currentProject .getConfigurations ().findByName (configurationName );
230229 if (runtimeClasspath != null ) {
231230 for (Configuration configuration : runtimeClasspath .getHierarchy ()) {
232231 for (Dependency dependency : configuration .getDependencies ()) {
@@ -258,7 +257,7 @@ private Project getDependentProject(ProjectDependency projectDependency) {
258257 // Try getDependencyProject() first (Gradle 6-8)
259258 try {
260259 java .lang .reflect .Method getDependencyProjectMethod =
261- projectDependency .getClass ().getMethod ("getDependencyProject" );
260+ projectDependency .getClass ().getMethod ("getDependencyProject" );
262261 return (Project ) getDependencyProjectMethod .invoke (projectDependency );
263262 } catch (ReflectiveOperationException e ) {
264263 // Fall through to getPath() approach (Gradle 9+)
@@ -271,7 +270,7 @@ private Project getDependentProject(ProjectDependency projectDependency) {
271270 return getProject ().project (path );
272271 } catch (ReflectiveOperationException e ) {
273272 throw new RuntimeException (
274- "Failed to resolve dependent project from " + projectDependency , e );
273+ "Failed to resolve dependent project from " + projectDependency , e );
275274 }
276275 }
277- }
276+ }
0 commit comments