Skip to content

Commit

Permalink
Now we can just do ./gradlew run, and it will provide identical funct…
Browse files Browse the repository at this point in the history
…ionality as before the plugin port.
  • Loading branch information
lagergren committed Dec 20, 2023
1 parent 687defc commit e7a7a30
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 56 deletions.
42 changes: 30 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# Logs and databases #
######################
#
# Logs and databases
#
*.log
*.out
*.tmp
*.temp
*.sql
*.sqlite

#
# OS generated files #
######################
#
.DS_Store
.DS_Store?
._*
Expand All @@ -17,20 +19,36 @@
ehthumbs.db
Thumbs.db

# build directory #
###################
#
# Build directories
#
build/

#
# Module aggregation directory:
#
# While we can still collect everyting into a common lib folder, as a final build step,
# if we want, the 'standard' Maven style way would be to just build and run the project.
# Every component declaratively states its dependencies to build and/or run, and any
# task using these dependencies gets them lazily resolved, and exactly what it needs,
# nothing more. We will likely implement a distribution config for XTC applications
# like this, of course, so that the old "lib" folder is some kind of versioned
# publishable artifact)
#
lib/

# xdk directory #
###################
#
# XDK directory
#
xdk/

# user-specific project files #
###############################
#
# User-specific project files
#
prj/
.idea/

# Gradle-specific project files #
#################################
.gradle
#
# Gradle caches
#
.gradle
56 changes: 19 additions & 37 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,32 @@ plugins {
dependencies {
xdkZip(libs.xdk)
xtcModule(project(":kernel"))
xtcModule(project(":common")) // runtime path
xtcModule(project(":platformDB")) // runtime path
xtcModule(project(":host")) // runtime path
xtcModule(project(":platformUI")) // runtime path
}

fun readPassword(): String {
val password = findProperty("org.xtclang.platform.password")?.toString() ?: ""
if (password.isEmpty()) {
throw GradleException("Error. No password was given.")
}
logger.lifecycle("Resolved password: [REDACTED]")
return password
}
//x/ec -L lib/ kernel.xtc [password]")

// The xtcRun plugin will give us runXtc<sourceSet> tasks, where
// it's just runXtc for the main source set
/*
* xtcRun is a configuration for anything launching from the main source set.
* xtcRunTest
*/
xtcRun {
verbose = true
// needs a password property
module {
moduleName = "kernel"
args(readPassword())
// TOOD: Check that grabbing properties through -P or -D or System.getenv works and maps to XTC properties.
// TODO: Implement arg() and args() syntactic sugar
args = listOf(readPassword())
}
}

val runXtc by tasks.existing {
dependsOn(tasks.build)
}

//println("Please run the platform directly using the following command:")
//println(" xec -L lib/ kernel.xtc [password]")
val run by tasks.registering {
group = "application"
description = "Build (if necessary) and run the platform (equivalent to 'xec [-L <module>]+ kernel.xtc <password>)"
Expand All @@ -46,27 +44,11 @@ val run by tasks.registering {
}
}

/*
val libDir = "${projectDir}/lib"
val build = tasks.register("build") {
group = "Build"
description = "Build all"
dependsOn(project(":kernel") .tasks["build"])
dependsOn(project(":host") .tasks["build"])
dependsOn(project(":platformDB").tasks["build"])
dependsOn(project(":platformUI").tasks["build"])
}
tasks.register("run") {
group = "Run"
description = "Run the platform"
dependsOn(build)
doLast {
println("Please run the platform directly using the following command:")
println(" xec -L lib/ kernel.xtc [password]")
internal fun readPassword(): String {
val password = findProperty("org.xtclang.platform.password")?.toString() ?: ""
if (password.isEmpty()) {
throw GradleException("Error. No password was given.")
}
}
*/
logger.lifecycle("Resolved password: [REDACTED]")
return password
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
group=platform.xqiz.it
version=0.1.0

xtcVersion=0.4.41
xtcVersion=0.4.44

# NOTE: This property would not live inside your repository for a production case, but
# should be passed through a Gradle command line property "-Porg.xtclang.platform.password=<password>>",
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
node = "7.0.1"
npm = "10.2.0"
yarn = "1.22.21"
xdk = "0.4.41"
xdk = "0.4.44"
tasktree = "2.1.1"

[plugins]
Expand Down
2 changes: 1 addition & 1 deletion platformUI/gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@quasar/extras": "^1.16.4",
"axios": "^1.2.1",
"pinia": "^2.0.11",
"quasar": "^2.14.1",
"quasar": "^2.14.2",
"vue": "^3.0.0",
"vue-router": "^4.0.0"
},
Expand Down
8 changes: 4 additions & 4 deletions platformUI/gui/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2919,10 +2919,10 @@ [email protected]:
dependencies:
side-channel "^1.0.4"

quasar@^2.14.1:
version "2.14.1"
resolved "https://registry.yarnpkg.com/quasar/-/quasar-2.14.1.tgz#3681cca0aff98b8eb5214b00c69dfdfcce58dfc9"
integrity sha512-TAIGUgHASlL7COS9qqfDKyV2+WGFcHQseIDTzN+yfXaXY5gn/FZqwkEnb87bgOqgGYw8KJerkfZg3aSel+bLPw==
quasar@^2.14.2:
version "2.14.2"
resolved "https://registry.yarnpkg.com/quasar/-/quasar-2.14.2.tgz#794d8434eb449549fc8455aaec9bc14b71a57c98"
integrity sha512-f5KliWtM5BEuFsDU4yvuP+dlVIWZNrGu5VpWFsxzjpoykcP4B2HIOUiCl3mx2NCqERHd4Ts0aeioRkt9TTeExA==

queue-microtask@^1.2.2:
version "1.2.3"
Expand Down

0 comments on commit e7a7a30

Please sign in to comment.