Compare commits
No commits in common. "main" and "0.3.0" have entirely different histories.
6 changed files with 57 additions and 46 deletions
|
@ -1,5 +1,5 @@
|
|||
// See: https://github.com/scalameta/scalafmt/tags for the latest tags.
|
||||
version = 3.9.4
|
||||
version = 3.7.17
|
||||
runner.dialect = scala3
|
||||
maxColumn = 80
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ for non-GS projects.
|
|||
```scala
|
||||
resolvers += "Garrity Software Releases" at "https://maven.garrity.co/gs"
|
||||
|
||||
addSbtPlugin("gs" % "sbt-garrity-software" % "0.4.0")
|
||||
addSbtPlugin("gs" % "sbt-garrity-software" % "0.1.0")
|
||||
```
|
||||
|
||||
**File: build.sbt**
|
||||
|
|
|
@ -1 +1 @@
|
|||
sbt.version=1.10.11
|
||||
sbt.version=1.9.9
|
||||
|
|
|
@ -3,8 +3,8 @@ package gs;
|
|||
import sbt._
|
||||
|
||||
object Gs {
|
||||
|
||||
/** Standard compiler options used by GS projects.
|
||||
/**
|
||||
* Standard compiler options used by GS projects.
|
||||
*/
|
||||
val CompilerOptions: Seq[String] = Seq(
|
||||
"-encoding",
|
||||
|
@ -21,66 +21,77 @@ object Gs {
|
|||
"-Wunused:imports", // Warn if an import selector is not referenced.
|
||||
"-Wunused:locals", // Warn if a local definition is unused.
|
||||
"-Wunused:privates", // Warn if a private member is unused.
|
||||
"-Wsafe-init" // Enable the safe initialization check.
|
||||
"-Ysafe-init" // Enable the experimental safe initialization check.
|
||||
)
|
||||
|
||||
/** Host of the GS Git server.
|
||||
/**
|
||||
* Definition of the MIT license. This is the default license for GS
|
||||
* open source projects.
|
||||
*/
|
||||
val MIT: (String, java.net.URL) =
|
||||
"MIT" -> sbt.url("https://garrity.co/MIT.html")
|
||||
|
||||
/**
|
||||
* Host of the GS Git server.
|
||||
*/
|
||||
val GitHost: String = "git.garrity.co"
|
||||
|
||||
/** Host of the Maven server.
|
||||
/**
|
||||
* Host of the Maven server.
|
||||
*/
|
||||
val MavenHost: String = "maven.garrity.co"
|
||||
|
||||
/** Realm of the Maven server.
|
||||
/**
|
||||
* Realm of the Maven server.
|
||||
*/
|
||||
val MavenRealm: String = "Reposilite"
|
||||
|
||||
/** Organization name used to organize projects in Git.
|
||||
/**
|
||||
* Organization name used to organize projects in Git.
|
||||
*/
|
||||
val GitOrganization: String = "garrity-software"
|
||||
|
||||
/** Human readable organization name.
|
||||
/**
|
||||
* Human readable organization name.
|
||||
*/
|
||||
val OrganizationName: String = "Garrity Software"
|
||||
|
||||
/** Maven Group ID for GS projects.
|
||||
/**
|
||||
* Maven Group ID for GS projects.
|
||||
*/
|
||||
val GroupId: String = "gs"
|
||||
|
||||
/** Calculate the Git repository for a project.
|
||||
/**
|
||||
* Calculate the Git repository for a project.
|
||||
*
|
||||
* @param projectName
|
||||
* The project name.
|
||||
* @return
|
||||
* The HTTPS Git repository URL.
|
||||
* @param projectName The project name.
|
||||
* @return The HTTPS Git repository URL.
|
||||
*/
|
||||
def gitRepo(projectName: String): String =
|
||||
s"https://$GitHost/$GitOrganization/$projectName"
|
||||
|
||||
/** Calculate the Git SSH target for a project.
|
||||
/**
|
||||
* Calculate the Git SSH target for a project.
|
||||
*
|
||||
* @param projectName
|
||||
* The project name.
|
||||
* @return
|
||||
* The SSH target.
|
||||
* @param projectName The project name.
|
||||
* @return The SSH target.
|
||||
*/
|
||||
def gitSsh(projectName: String): String =
|
||||
s"git@$GitHost:$GitOrganization/$projectName.git"
|
||||
s"git@$GitHost:$GitOrganization/${projectName}.git"
|
||||
|
||||
object Environment {
|
||||
val MavenUser: String = "GS_MAVEN_USER"
|
||||
val MavenToken: String = "GS_MAVEN_TOKEN"
|
||||
}
|
||||
|
||||
/** Prefers to load credentials from file, if a file is available. Otherwise
|
||||
/**
|
||||
* Prefers to load credentials from file, if a file is available. Otherwise
|
||||
* mandates that the following environment variables exist:
|
||||
*
|
||||
* - `GS_MAVEN_USER`
|
||||
* - `GS_MAVEN_TOKEN`
|
||||
*
|
||||
* @return
|
||||
* The selected credentials for GS Maven.
|
||||
* @return The selected credentials for GS Maven.
|
||||
*/
|
||||
def selectCredentials(): Credentials =
|
||||
if ((Path.userHome / ".sbt" / ".credentials").exists())
|
||||
|
@ -104,5 +115,4 @@ object Gs {
|
|||
)
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
|
|
|
@ -6,12 +6,12 @@ import sbt._
|
|||
*/
|
||||
object GsKeys {
|
||||
|
||||
/** Required setting for projects using the Garrity Software plugin. This
|
||||
/**
|
||||
* Required setting for projects using the Garrity Software plugin. This
|
||||
* value must match the Git repository name. This value is used to configure
|
||||
* publishing and generate sub-project names.
|
||||
*/
|
||||
lazy val gsProjectName = settingKey[String](
|
||||
"Name of the project and Git repository."
|
||||
)
|
||||
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ object GsPlugin extends AutoPlugin {
|
|||
connection = Gs.gitSsh(gsProjectName.value)
|
||||
)
|
||||
),
|
||||
licenses := List(Gs.MIT),
|
||||
homepage := Some(url(Gs.gitRepo(gsProjectName.value))),
|
||||
organizationName := Gs.OrganizationName,
|
||||
organization := Gs.GroupId,
|
||||
|
|
Loading…
Add table
Reference in a new issue