File tree Expand file tree Collapse file tree 5 files changed +31
-9
lines changed
Expand file tree Collapse file tree 5 files changed +31
-9
lines changed Original file line number Diff line number Diff line change @@ -74,9 +74,15 @@ clojure -e "(println)" &>/dev/null
7474output::step " Reading Leiningen project properties"
7575
7676lein_project_plugins=$( " ${BUILDPACK_DIR} /opt/get_project_property.clj" " ${BUILD_DIR} /project.clj" " plugins" )
77- lein_project_uberjar_name=$( " ${BUILDPACK_DIR} /opt/get_project_property.clj" " ${BUILD_DIR} /project.clj" " uberjar-name" )
7877lein_project_min_lein_version=$( " ${BUILDPACK_DIR} /opt/get_project_property.clj" " ${BUILD_DIR} /project.clj" " min-lein-version" )
7978
79+ lein_project_uberjar_name=$( " ${BUILDPACK_DIR} /opt/get_project_property.clj" " ${BUILD_DIR} /project.clj" " uberjar-name" )
80+ # The :uberjar profile is automatically activated by Leiningen when running "lein uberjar".
81+ # Check for :uberjar-name inside this profile if it's not defined at the top level.
82+ if [[ -z " ${lein_project_uberjar_name} " ]]; then
83+ lein_project_uberjar_name=$( " ${BUILDPACK_DIR} /opt/get_project_property.clj" " ${BUILD_DIR} /project.clj" " profiles" " uberjar" " uberjar-name" )
84+ fi
85+
8086if grep -q lein-npm <<< " ${lein_project_plugins}" ; then
8187 if ! command -v npm & > /dev/null; then
8288 output::error << -EOF
Original file line number Diff line number Diff line change 11{
22 "hatchet" : {
33 "directory" : " test/spec/fixtures"
4- }
4+ },
5+ "github" : [" heroku/clojure-getting-started" ]
56}
Original file line number Diff line number Diff line change 1- --- []
1+ ---
2+ - - test/spec/fixtures/repos/github/clojure-getting-started
3+ - main
Original file line number Diff line number Diff line change 1414
1515(when (< (count *command-line-args*) 2 )
1616 (binding [*out* *err*]
17- (println " Usage: get_project_property.clj <project.clj> <property-name>" ))
17+ (println " Usage: get_project_property.clj <project.clj> <property-name> [<nested-key>...] " ))
1818 (System/exit 1 ))
1919
20- (defn get-project-property [file-path property-name ]
20+ (defn get-project-property [file-path & property-path ]
2121 (let [project-data (read-string (slurp file-path))
22- properties (apply hash-map (drop 3 project-data))]
23- (get properties (keyword property-name))))
22+ properties (apply hash-map (drop 3 project-data))
23+ key-path (map keyword property-path)]
24+ (get-in properties key-path)))
2425
2526(let [file-path (first *command-line-args*)
26- property-name ( second *command-line-args*)
27- property-value (get-project-property file-path property-name )]
27+ property-path ( rest *command-line-args*)
28+ property-value (apply get-project-property file-path property-path )]
2829 (println (or property-value " " )))
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ require_relative 'spec_helper'
4+
5+ RSpec . describe 'Clojure buildpack' do
6+ it 'can build and run Heroku\'s Clojure getting started app' do
7+ app = Hatchet ::Runner . new ( 'clojure-getting-started' )
8+ app . deploy do
9+ expect ( http_get ( app ) ) . to include ( 'Hello from Heroku' )
10+ end
11+ end
12+ end
You can’t perform that action at this time.
0 commit comments