-
Notifications
You must be signed in to change notification settings - Fork 6
WIP: Fetch from Clojars & better SNAPSHOT support #11
Conversation
315d183
to
778cf34
Compare
This isn't properly functioning yet for a few reasons:
Copying some stuff from Slack:@micha @alandipert if you have a moment can you clarify the differences between
Could we eliminate one of them? do we need both? Actually it seems that the Also it seems that |
5dab96c
to
244b6e5
Compare
if (Arrays.equals(stack.toArray(), marker) && snapshotVersion == null) { | ||
// String versionString = new String(ch, start, length); | ||
// System.out.println("version " + versionString); | ||
snapshotVersion = new String(ch, start, length); }}}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't feel terribly robust but at the same time it should work with all the maven metadata files I've seen. Thoughts?
EDIT by this I mean the logic how we decide when we have found a proper version string.
244b6e5
to
28caf61
Compare
src/Boot.java
Outdated
@@ -182,7 +183,14 @@ | |||
|
|||
public static String | |||
downloadUrl(String version, String name) throws Exception { | |||
return String.format("https://github.com/boot-clj/boot/releases/download/%s/%s", version, name); } | |||
if (0 < version.compareTo("2.8") && name.equals("boot.jar")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hacky version comparison — could this be done better?
Also guarding that boot.sh
isn't requested, it should never be as per #9 however.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't fully understand all the context here, but Clojars also has an API that you could use to lookup the latest version of Boot, which would mean you wouldn't need to do SNAPSHOT releases, and would probably give you enough info to download the JAR without parsing the maven-metadata.xml file?
src/Boot.java
Outdated
@@ -182,7 +183,14 @@ | |||
|
|||
public static String | |||
downloadUrl(String version, String name) throws Exception { | |||
return String.format("https://github.com/boot-clj/boot/releases/download/%s/%s", version, name); } | |||
if (0 < version.compareTo("2.8") && name.equals("boot.jar")) { | |||
String urlFormat = "https://clojars.org/repo/boot/base/%s/base-%s-uber.jar"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use https://repo.clojars.org/boot/base/...
to get the CDN version.
@danielcompton Thanks for your feedback! The issue with non-snapshot builds is that any invocation of An alternative solution to this issue could be modifying One benefit of snapshots is also that we could publish pre-releases as part of CI for new commits on Maybe this needs more thought. Would greatly welcome additional input! |
FYI, I will split this PR into two:
|
This change shouldn't have any effect until the respective FEATURE FLAG is switched on.
28caf61
to
b5ea8a7
Compare
I updated this PR with only the changes needed to download boot/base from Clojars.
|
This issue has been resolved in the superseding project. |
This is still very much a work in progress but opening a PR for feedback.
Some of the motivation for this has been outlined in https://github.com/boot-clj/boot-bin/issues/6
Besides speed this will also greatly simplify the release process of SNAPSHOTs.
Currently whenever a SNAPSHOT release is being cut we need to create a release on Github. This in itself is a bit of manual labor but fine. The problem is that Github releases are thought of as immutable. You can update files attached to a release but nobody will notice.
This makes it hard for Boot maintainers to ship development builds, making it harder for people to test those etc.pp.
If you believe we shouldn't be using SNAPSHOTs at all chat me up in
#boot-dev
on Slack. I've thought how we could use proper releases but couldn't come up with an approach that would keepboot -u
work as it currently does.One Caveat/Feature: If you're running a SNAPSHOT it won't update automatically. You'll need to remove the respective files in
~/.boot/cache/bin/$VERSION
to trigger a redownload of the updated SNAPSHOT.