-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get publishing to Sonatype working #3
Conversation
requires: | ||
- "openjdk8-scala2.12" | ||
filters: | ||
tags: | ||
only: | ||
- /^(.*)$/ | ||
branches: | ||
ignore: | ||
- /^(.*)$/ | ||
only: |
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.
Reminder to restore this before merging.
|
||
cancelable in Global := true | ||
onLoad in Global ~= (_ andThen ("project core" :: _)) |
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 was preventing scalafmtSbtCheck
from having visibility into the top-level *.sbt
and project/*.scala
files.
See the alternative approach below with a root project.
) | ||
) | ||
|
||
lazy val noPublishSettings = Seq( |
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 is so we don't publish the root project.
Resolver.ivyStylePatterns | ||
) | ||
) | ||
lazy val credentialSettings = Seq( |
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.
Some improvements to this block, courtsey of Eugene, geotrellis/vectorpipe@227de4f.
@@ -2,7 +2,7 @@ | |||
|
|||
set -e | |||
|
|||
if [[ -n "${STAC4S_SERVER_DEBUG}" ]]; then |
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.
My guess is this was borrowed from GeoTrellis Server and there was a control + find and replace operation that left this behind.
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.
Looks good, I'd like to see the changes around Dependencies.scala
reverted before merging though.
One small nitpick on the updated ./scripts/test
too
project/Dependencies.scala
Outdated
val ScapegoatVersion = "1.3.8" | ||
val Specs2Version = "4.6.0" | ||
val TapirVersion = "0.10.1" | ||
val CatsVersion = "1.6.0" |
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 rather keep the versions and dependencies in build.sbt
and delete this file - or at the very least only have library versions in here. It's a lot easier to keep dependencies in check by keeping it in one file -- there's an argument made for that here for franklin
in that it helps us when using sbt-explicit-dependencies
.
To replicate what is done in the PR referenced there would require inlining the dependencies, but that's kind of outside the scope originally for the issue this PR so I'm happy to do that myself later.
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.
sbt-explicit-dependencies
is really really nice. I agree that the approach in Franklin looks better too.
if [[ "${1:-}" == "--help" ]]; then | ||
usage | ||
else | ||
echo "Linting Scala source code and executing tests" |
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 decided not to carry over the color codes because they weren't working on my system:
maiden:~ rbreslow$ echo -e "\e[32m[stac4s] Executing Scala Tests and Linting\e[0m"
\e[32m[stac4s] Executing Scala Tests and Linting\e[0m
Also, for consistency, because we weren't using them in cipublish
.
If we were to include color codes, I would suggest an alternative approach that is portable (with printf
) and provides more readable code:
diff --git a/scripts/test b/scripts/test
index 8a4de5f..816a1e7 100755
--- a/scripts/test
+++ b/scripts/test
@@ -13,11 +13,16 @@ Lint Scala source code and execute tests.
"
}
+function success() {
+ printf "$(tput setaf 2)%s$(tput sgr0)\n" $1
+}
+
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
if [[ "${1:-}" == "--help" ]]; then
usage
else
- echo "Linting Scala source code and executing tests"
+ success "Linting Scala source code and executing tests"
+
./sbt ";\
scalafix --check; \
scalafmtCheck; \
I would also consider whether the value the color codes add to the script outweighs what they subtract in terms of complexity and decreased readability. If it is something we want to standardize on, which is totally cool, it may be worth extending the STRTA ADR so we can get every repository on the same page going forward.
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.
Cool, I like your change -- in general I find the colors to be helpful in parsing the output of our STRTA commands (what's the command vs what's log output from processes the command invokes to be helpful). As to whether the increase in complexity for STRTA outweighs its usefulness - I would say that once written our STRTA commands aren't edited that much, but we run them often so it seems like a fair tradeoff.
Nevertheless, I don't think this change should hold up the PR since it's more a matter of preference and the original edit didn't seem related to the goal of publishing artifacts.
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.
in general I find the colors to be helpful in parsing the output of our STRTA commands (what's the command vs what's log output from processes the command invokes to be helpful).
Agreed. It's definitely helpful.
As to whether the increase in complexity for STRTA outweighs its usefulness - I would say that once written our STRTA commands aren't edited that much, but we run them often so it seems like a fair tradeoff.
The thing in my mind is, if we replicate a success
or log
function across all the STRTA, there's more to parse and possibly distract when reading each file. Embedding the color codes in the printf
statement introduces a different set of readability concerns. I agree with your perspective though, if we standardize on this, it might eventually become background noise.
At a higher level, it may be worth revisiting the STRTA ADR, because many projects have been deviating from the standards and that document should be updated for how we're developing apps today (Vagrant seems to be disused, etc).
Overview
The following changes were made in an effort to get publishing to Sonatype working:
publishSettings
tocore
projectDependencies.scala
to align with other Scala project organization and to fix failing tests due toVersions.ScapegoatVersion
reference erroronLoad
setting and aggregatecore
under a root project instead so thatscalafmtSbtCheck
has visibility into top-level*.sbt
andproject/*.scala
filesConnects https://github.com/azavea/raster-foundry-platform/issues/899
Testing Instructions
See CircleCI build: https://app.circleci.com/jobs/github/azavea/stac4s/13
Retrieve the Azavea public key:
Verify the signature of the published artifact: