Skip to content

Commit

Permalink
feat: add organization name and homepage parameters and dynamically s…
Browse files Browse the repository at this point in the history
…et them in the project settings, license and readme
  • Loading branch information
JavierCane committed Jun 22, 2024
1 parent 76f8eac commit 3e33898
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/main/g8/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2024 $organization$ https://$organization$
Copyright (c) 2024 $organization_name$ $organization_homepage$

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 4 additions & 6 deletions src/main/g8/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# ✨ $name$

[![License](https://img.shields.io/github/license/$organization$/$name;format="lower,snake"$?style=flat-square)](/LICENSE)
[![License](https://img.shields.io/github/license/$organization;format="dotReverse"$/$name;format="lower,hyphen"$?style=flat-square)](/LICENSE)

[![GitHub Repo stars](https://img.shields.io/github/stars/$organization$/$name;format="lower,snake"$?style=flat-square)](https://github.com/$organization$/$name;format="lower,snake"$/stargazers)
[![GitHub Repo stars](https://img.shields.io/github/stars/$organization;format="dotReverse"$/$name;format="lower,hyphen"$?style=flat-square)](https://github.com/$organization;format="dotReverse"$/$name;format="lower,hyphen"$/stargazers)

[![Continuous Integration status](https://img.shields.io/github/actions/workflow/status/$organization$/$name;format="lower,snake"$/ci.yml?style=flat-square)](https://github.com/$organization$/$name;format="lower,snake"$/actions/workflows/ci.yml)

$description$
[![Continuous Integration status](https://img.shields.io/github/actions/workflow/status/$organization;format="dotReverse"$/$name;format="lower,hyphen"$/ci.yml?style=flat-square)](https://github.com/$organization;format="dotReverse"$/$name;format="lower,hyphen"$/actions/workflows/ci.yml)

## 🚀 Environment setup

Expand Down Expand Up @@ -65,4 +63,4 @@ See [`LICENSE`](LICENSE).

## 🤔 About

Project developed by $organization$ and bootstrapped with the [Codely Scala Basic Skeleton (powered by Giter 8)](https://github.com/CodelyTV/scala-basic-skeleton.g8).
Project developed by [$organization_name$]($organization_homepage$) and bootstrapped with the [Codely Scala Basic Skeleton (powered by Giter 8)](https://github.com/CodelyTV/scala-basic-skeleton.g8).
12 changes: 7 additions & 5 deletions src/main/g8/default.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
sbt_version = maven(org.scala-sbt, sbt, stable)
scala_version = maven(org.scala-lang, scala-library, stable)
name = Your awesome project
version = 1.0
description = Project bootstrapped using the Codely Scala Basic Skeleton
organization = com.codely
version = 0.1.0-SNAPSHOT
organization = com.example
organization_name = $organization;format="dotReverse"$, Inc.
organization_homepage = https://$organization;format="dotReverse"$
package = $organization$.$name;format="lower,snake"$
Lets_start_with_dependencies_versions-Suggestions_based_on_the_latest_available_ones = ok
sbt_version = maven(org.scala-sbt, sbt, stable)
scala_version = maven(org.scala-lang, scala-library, stable)
scalafmt_version = maven(org.scalameta, scalafmt-core_2.13, stable)
scalatest_version = maven(org.scalatest, scalatest_2.13, stable)
scalamock_version = maven(org.scalamock, scalamock_2.13, stable)
Expand Down
22 changes: 12 additions & 10 deletions src/main/g8/project/ProjectConfiguration.scala
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
import sbt.{Compile, Test, TestFrameworks, Tests, Configuration => _}
import sbt.{Compile, Configuration => _, Test, TestFrameworks, Tests}
import sbt.Keys._
import sbt.io.syntax._

object ProjectConfiguration {
val settings = Seq(
organization := "$organization$",
scalaVersion := "$scala_version$",
val settings = Seq(
name := "$name$",
version := "$version$",
scalaVersion := "$scala_version$",
organization := "$organization$",
organizationName := "$organization_name$",
organizationHomepage := Some(url("$organization_homepage$")),

// Custom folders path (remove the `/scala` default subdirectory)
Compile / scalaSource := file((baseDirectory.value / "src" / "main").toString),
Test / scalaSource := file((baseDirectory.value / "src" / "test").toString),
Test / scalaSource := file((baseDirectory.value / "src" / "test").toString),

// Compiler options
scalacOptions ++= Seq(
"-deprecation", // Warnings deprecation
"-feature", // Advise features
"-unchecked", // More warnings. Strict
"-Xlint", // More warnings when compiling
"-feature", // Advise features
"-unchecked", // More warnings. Strict
"-Xlint", // More warnings when compiling
"-Ywarn-dead-code",
"-Ywarn-unused"
),
Test / scalacOptions += "-Xcheckinit", // Check against early initialization only in tests because it's expensive
javaOptions += "-Duser.timezone=UTC",

// Test options
Test / parallelExecution := false,
Test / parallelExecution := false,
Test / testForkedParallel := false,
Test / fork := true,
Test / fork := true,
Test / testOptions ++= Seq(
Tests.Argument(TestFrameworks.ScalaTest, "-u", "target/test-reports"), // Save test reports
Tests.Argument("-oDF") // Show full stack traces and time spent in each test
Expand Down

0 comments on commit 3e33898

Please sign in to comment.