Skip to content

Commit 9ae3c0b

Browse files
committed
code cleanup on TDEPS-276
1 parent 5524e1b commit 9ae3c0b

3 files changed

Lines changed: 12 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Changelog
33

44
*Also see [Tools and installer changelog](https://github.com/clojure/brew-install/blob/1.12.4/CHANGELOG.md)*
55

6+
* next
7+
* Code clean up on TDEPS-276
68
* 0.29.1598 on Mar 3, 2026
79
* TDEPS-276 - Extract source paths from local pom.xml sources defined with build-helper-maven-plugin
810
* 0.29.1593 on Feb 12, 2026

src/main/clojure/clojure/tools/deps/extensions/pom.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@
136136
(let [^Plugin plugin (first plugins)
137137
extract-dirs (fn [^Plugin plugin goal ^String children]
138138
(->> (.getExecutions plugin)
139-
(filter (fn [^PluginExecution exec] (.contains ^List (.getGoals exec) goal)))
139+
(filter (fn [^PluginExecution exec]
140+
(.contains ^List (.getGoals exec) goal)))
140141
(mapcat (fn [^PluginExecution exec]
141-
(let [^Xpp3Dom config (.getConfiguration exec)
142-
^Xpp3Dom sources (.getChild config children)]
143-
(map #(.getValue ^Xpp3Dom %) (.getChildren sources)))))))]
142+
(map #(.getValue ^Xpp3Dom %)
143+
(some-> exec .getConfiguration (Xpp3Dom/.getChild children) Xpp3Dom/.getChildren))))))]
144144
(concat
145145
(extract-dirs plugin "add-source" "sources")
146146
(extract-dirs plugin "add-resource" "resources"))))))

src/test/clojure/clojure/tools/deps/extensions/pom.clj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
(:import [java.io File]))
88

99
(deftest tdeps-276-build-helper-src-dir
10-
(let [paths (ext/coord-paths 'foo/foo {:deps/root "test-data/pom-extra-src" :deps/manifest :pom}
11-
:pom {:mvn/repos maven/standard-repos})]
12-
(is (contains? (set paths) (.getAbsolutePath (File. "test-data/pom-extra-src/s1"))))
13-
(is (contains? (set paths) (.getAbsolutePath (File. "test-data/pom-extra-src/s2"))))
14-
(is (contains? (set paths) (.getAbsolutePath (File. "test-data/pom-extra-src/r1"))))
15-
(is (contains? (set paths) (.getAbsolutePath (File. "test-data/pom-extra-src/r2"))))))
10+
(let [paths (set (ext/coord-paths 'foo/foo {:deps/root "test-data/pom-extra-src" :deps/manifest :pom}
11+
:pom {:mvn/repos maven/standard-repos}))]
12+
(is (contains? paths (.getAbsolutePath (File. "test-data/pom-extra-src/s1"))))
13+
(is (contains? paths (.getAbsolutePath (File. "test-data/pom-extra-src/s2"))))
14+
(is (contains? paths (.getAbsolutePath (File. "test-data/pom-extra-src/r1"))))
15+
(is (contains? paths (.getAbsolutePath (File. "test-data/pom-extra-src/r2"))))))
1616

1717
(comment
1818
(tdeps-276-build-helper-src-dir)

0 commit comments

Comments
 (0)