redstarssystems / apptemplate

Application project template for Clojure
Eclipse Public License 1.0
34 stars 0 forks source link

Made a new project, environments are still using example values... #1

Open xicubed opened 2 years ago

xicubed commented 2 years ago

I followed the example and it worked great. Used this method. clojure -Sdeps '{:deps {org.rssys/apptemplate {:git/tag "0.1.1" :git/sha "215be27" :git/url "https://github.com/redstarssystems/apptemplate.git"}}}' -Tnew create :template org.rssys/apptemplate :name com.example/app01

But when I created another project with my own project name and namespace...

clojure -Sdeps '{:deps {org.rssys/apptemplate {:git/tag "0.1.1" :git/sha "215be27" :git/url "https://github.com/redstarssystems/apptemplate.git"}}}' -Tnew create :template org.rssys/apptemplate :name edu.myown.name/myownproject

and go to bb build I somehow get the old com.example.app01 and app01

Project settings:
{:java-src-folders ["java-src"],
 :main-ns com.example.app01,
 :group-id "com.example",
 :release? false,
 :artifact-id "app01",
...
:artifact com.example/app01,

Writing pom.xml...
Copying src, resources...
Compiling com.example.app01...
Execution error (FileNotFoundException) at user/eval136 (compile.clj:6).
Could not locate com/example/app01__init.class, com/example/app01.clj or com/example/app01.cljc on classpath.

Which makes sense because there's nothing there its in the new location.

xicubed commented 2 years ago

For now I've just over-ridden certain values in the build.clj. My repo uses main instead of master. I also looked at adding a template/pom.xml template at the root level and added a reference to it in the defn uberjar in the build.cjl (as described in https://github.com/seancorfield/build-clj) (assoc :lib (:artifact project-env) :version (:artifact-version project-env) :src-pom "template/pom.xml" :main (:main-ns project-env)) that got me further but not all the way maybe.

;:group-id              (System/getenv "group-id")
:group-id              (clojure.edn/read-string (str "edu.myown.name"))
;:artifact-id           (System/getenv "artifact-id")
:artifact-id           (clojure.edn/read-string (str "myownproject"))
;:artifact              (symbol (System/getenv "artifact"))
:artifact              (clojure.edn/read-string (str "edu.myown.name/myownproject"))
;:main-ns               (symbol (System/getenv "main-ns"))
:main-ns               (clojure.edn/read-string (str "edu.myown.name.myownproject"))
;:release-branches      (System/getenv "release-branches")
:release-branches      (clojure.edn/read-string "\"#{\\\"main\\\"}\"")
;:deployable-branches   (System/getenv "deployable-branches")
:deployable-branches   (clojure.edn/read-string "\"#{\\\"develop\\\" \\\"main\\\"}\"")
mikeananev commented 2 years ago

Hello. Sorry for the late answer.

I've tried the command you described: clojure -Sdeps '{:deps {org.rssys/apptemplate {:git/tag "0.1.1" :git/sha "215be27" :git/url "https://github.com/redstarssystems/apptemplate.git"}}}' -Tnew create :template org.rssys/apptemplate :name edu.myown.name/myownproject I can't reproduce the error. Did you create new project in the same folder?