Skip to content
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

Plugin config and asset improvements #593

Merged
merged 8 commits into from
Sep 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions demos/pirate/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ lazy val pirate =
indigoOptions :=
IndigoOptions.defaults
.withTitle("The Cursed Pirate")
.withWindowStartWidth(1280)
.withWindowStartHeight(720)
.withWindowWidth(1280)
.withWindowHeight(720)
.withBackgroundColor("black"),
libraryDependencies ++= Seq(
"io.indigoengine" %%% "indigo-json-circe" % IndigoVersion.getVersion, // Needed for Aseprite & Tiled support
Expand Down
4 changes: 2 additions & 2 deletions demos/snake/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ object snake extends ScalaJSModule with MillIndigo with ScalafmtModule {
val indigoOptions: IndigoOptions =
IndigoOptions.defaults
.withTitle("Snake - Made with Indigo")
.withWindowStartWidth(720)
.withWindowStartHeight(516)
.withWindowWidth(720)
.withWindowHeight(516)
.withBackgroundColor("black")

def buildGame() = T.command {
Expand Down
32 changes: 16 additions & 16 deletions examples/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ lazy val tiled =
.withTitle("Tiled example")
.withBackgroundColor("black")
.withAssetDirectory("tiled/assets")
.withWindowStartWidth(19 * 32)
.withWindowStartHeight(11 * 32),
.withWindowWidth(19 * 32)
.withWindowHeight(11 * 32),
libraryDependencies ++= Seq(
"io.indigoengine" %%% "indigo-json-circe" % IndigoVersion.getVersion
)
Expand Down Expand Up @@ -256,8 +256,8 @@ lazy val fireworks =
.withTitle("Fireworks!")
.withBackgroundColor("black")
.withAssetDirectory("fireworks/assets")
.withWindowStartWidth(1280)
.withWindowStartHeight(720),
.withWindowWidth(1280)
.withWindowHeight(720),
libraryDependencies ++= Seq(
"org.scalacheck" %%% "scalacheck" % "1.15.3" % "test"
)
Expand Down Expand Up @@ -290,8 +290,8 @@ lazy val lighting =
.withTitle("Lighting")
.withBackgroundColor("black")
.withAssetDirectory("lighting/assets")
.withWindowStartWidth(684)
.withWindowStartHeight(384)
.withWindowWidth(684)
.withWindowHeight(384)
)
.settings(
publish := {},
Expand All @@ -310,8 +310,8 @@ lazy val distortion =
.withTitle("Distortion Example")
.withBackgroundColor("black")
.withAssetDirectory("distortion/assets")
.withWindowStartWidth(684)
.withWindowStartHeight(384)
.withWindowWidth(684)
.withWindowHeight(384)
)
.settings(
publish := {},
Expand Down Expand Up @@ -382,8 +382,8 @@ lazy val jobs =
.withTitle("Job System Example")
.withBackgroundColor("black")
.withAssetDirectory("jobs/assets")
.withWindowStartWidth(400)
.withWindowStartHeight(400)
.withWindowWidth(400)
.withWindowHeight(400)
)

lazy val confetti =
Expand All @@ -399,8 +399,8 @@ lazy val confetti =
.withTitle("Confetti")
.withBackgroundColor("black")
.withAssetDirectory("confetti/assets")
.withWindowStartWidth(640)
.withWindowStartHeight(480)
.withWindowWidth(640)
.withWindowHeight(480)
)

lazy val inputmapper =
Expand All @@ -416,8 +416,8 @@ lazy val inputmapper =
.withTitle("Input Mapper Example")
.withBackgroundColor("black")
.withAssetDirectory("inputmapper/assets")
.withWindowStartWidth(400)
.withWindowStartHeight(400)
.withWindowWidth(400)
.withWindowHeight(400)
)

lazy val mouseevents =
Expand Down Expand Up @@ -448,8 +448,8 @@ lazy val errors =
.withTitle("Error Handling")
.withBackgroundColor("black")
.withAssetDirectory("errors/assets")
.withWindowStartWidth(800)
.withWindowStartHeight(800)
.withWindowWidth(800)
.withWindowHeight(800)
)

// Root
Expand Down
46 changes: 7 additions & 39 deletions indigo-plugin/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@ import mill.scalalib.scalafmt._
import coursier.maven.MavenRepository
import publish._

import $ivy.`io.github.davidgregory084::mill-tpolecat::0.3.5`
import io.github.davidgregory084.TpolecatModule

object `indigo-plugin` extends Cross[IndigoPluginModule]("2.12", "2.13")
trait IndigoPluginModule extends CrossScalaModule with PublishModule with ScalafmtModule {
def indigoVersion = T.input { IndigoVersion.getVersion }

trait IndigoPluginModule extends CrossScalaModule with PublishModule with ScalafmtModule with TpolecatModule {
def indigoVersion = T.input(IndigoVersion.getVersion)

def scalaVersion =
crossScalaVersion match {
case "2.12" => "2.12.17"
case "2.13" => "2.13.10"
case _ => "2.13.10"
case _ => "2.13.10"
}

def artifactName = "indigo-plugin"
Expand All @@ -31,18 +35,13 @@ trait IndigoPluginModule extends CrossScalaModule with PublishModule with Scalaf
)
}

def scalacOptions =
ScalacOptions.scala213Compile

object test extends ScalaTests {
def ivyDeps =
Agg(
ivy"org.scalameta::munit:0.7.29"
)

def testFramework = "munit.Framework"

def scalacOptions = ScalacOptions.scala213Test
}

def publishVersion = indigoVersion()
Expand Down Expand Up @@ -88,34 +87,3 @@ object IndigoVersion {
rec(".indigo-version", 0, None)
}
}

object ScalacOptions {

lazy val scala213Compile: Seq[String] =
Seq(
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"-encoding",
"utf-8", // Specify character encoding used by source files.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-language:existentials", // Existential types (besides wildcard types) can be written and inferred
"-language:experimental.macros", // Allow macro definition (besides implementation and application)
"-language:higherKinds", // Allow higher-kinded types
"-language:implicitConversions", // Allow definition of implicit functions called views
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
"-Xfatal-warnings" // Fail the compilation if there are any warnings.
)

lazy val scala213Test: Seq[String] =
Seq(
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"-encoding",
"utf-8", // Specify character encoding used by source files.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-language:existentials", // Existential types (besides wildcard types) can be written and inferred
"-language:experimental.macros", // Allow macro definition (besides implementation and application)
"-language:higherKinds", // Allow higher-kinded types
"-language:implicitConversions", // Allow definition of implicit functions called views
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
)

}
2 changes: 2 additions & 0 deletions indigo-plugin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ rm -fr out/
./mill clean indigo-plugin[2.13]
./mill indigo-plugin[2.12].compile
./mill indigo-plugin[2.13].compile
./mill indigo-plugin[2.12].test
./mill indigo-plugin[2.13].test
./mill indigo-plugin[2.12].checkFormat
./mill indigo-plugin[2.13].checkFormat
./mill indigo-plugin[2.12].publishLocal
Expand Down
Loading
Loading