Skip to content

Commit

Permalink
GH-45347: [Packaging][Linux] Use cpp/CMakeLists.txt instead of java/p…
Browse files Browse the repository at this point in the history
…om.xml to detect version (#45348)

### Rationale for this change

java/pom.xml was moved to apache/arrow-java from apache/arrow.

### What changes are included in this PR?

Detect version from cpp/CMakeLists.txt.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: #45347

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
  • Loading branch information
kou authored Jan 27, 2025
1 parent 4408e2b commit f373c11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dev/tasks/linux-packages/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ def detect_version(release_time)
version_env = ENV["ARROW_VERSION"]
return version_env if version_env

pom_xml_path = File.join(arrow_source_dir, "java", "pom.xml")
pom_xml_content = File.read(pom_xml_path)
version = pom_xml_content[/^ <version>(.+?)<\/version>/, 1]
cmakelists_txt_path = File.join(arrow_source_dir, "cpp", "CMakeLists.txt")
cmakelists_txt_content = File.read(cmakelists_txt_path)
version = cmakelists_txt_content[/^set\(ARROW_VERSION "(.+?)"/, 1]
formatted_release_time = release_time.strftime("%Y%m%d")
version.gsub(/-SNAPSHOT\z/) {"-dev#{formatted_release_time}"}
end
Expand Down

0 comments on commit f373c11

Please sign in to comment.