Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Submit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIP
Labrador
Submit
Commits
be3ca569
Commit
be3ca569
authored
Jan 9, 2024
by
Ruben Backx
Browse files
Options
Downloads
Patches
Plain Diff
Change sass to use local install instead of outdated gradle plugin
parent
c63b9d89
Branches
Branches containing commit
No related tags found
1 merge request
!229
Version 2.2.1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
build.gradle.kts
+32
-5
32 additions, 5 deletions
build.gradle.kts
with
32 additions
and
5 deletions
build.gradle.kts
+
32
−
5
View file @
be3ca569
...
@@ -2,6 +2,7 @@ import com.diffplug.gradle.spotless.SpotlessExtension
...
@@ -2,6 +2,7 @@ import com.diffplug.gradle.spotless.SpotlessExtension
import
org.springframework.boot.gradle.tasks.bundling.BootJar
import
org.springframework.boot.gradle.tasks.bundling.BootJar
import
nl.javadude.gradle.plugins.license.DownloadLicensesExtension
import
nl.javadude.gradle.plugins.license.DownloadLicensesExtension
import
nl.javadude.gradle.plugins.license.LicenseExtension
import
nl.javadude.gradle.plugins.license.LicenseExtension
import
java.nio.file.Files
group
=
"nl.tudelft.submit"
group
=
"nl.tudelft.submit"
version
=
"2.2.0"
version
=
"2.2.0"
...
@@ -71,8 +72,6 @@ plugins {
...
@@ -71,8 +72,6 @@ plugins {
// Open API generator for generating the Client code for Labracore.
// Open API generator for generating the Client code for Labracore.
// is this needed?
// is this needed?
// id("org.openapi.generator").version("4.2.3")
// id("org.openapi.generator").version("4.2.3")
id
(
"com.unclezs.gradle.sass"
).
version
(
"1.0.10"
)
}
}
sourceSets
{
sourceSets
{
...
@@ -218,9 +217,37 @@ tasks.withType<Test>().configureEach {
...
@@ -218,9 +217,37 @@ tasks.withType<Test>().configureEach {
}
}
// Configure the sass compiling task to use the sass and css directories.
// Configure the sass compiling task to use the sass and css directories.
sass
{
tasks
.
register
(
"ensureDirectory"
)
{
cssPath
=
"static/css"
// Store target directory into a variable to avoid project reference in the configuration cache
sassPath
=
"scss"
val
directories
=
listOf
(
file
(
"src/main/resources/static/css"
),
file
(
"src/main/resources/scss"
))
doLast
{
directories
.
forEach
{
directory
->
Files
.
createDirectories
(
directory
.
toPath
())
}
}
}
task
<
Exec
>(
"sassCompile"
)
{
dependsOn
.
add
(
tasks
.
getByName
(
"ensureDirectory"
))
if
(
System
.
getProperty
(
"os.name"
).
contains
(
"windows"
,
true
))
{
commandLine
(
"cmd"
,
"/c"
,
"sass"
,
"src/main/resources/scss:src/main/resources/static/css"
)
}
else
{
commandLine
(
"echo"
,
"Checking for sass or sassc..."
)
doLast
{
val
res
=
exec
{
isIgnoreExitValue
=
true
executable
=
"bash"
args
=
listOf
(
"-l"
,
"-c"
,
"sass --version"
)
}
if
(
res
.
exitValue
==
0
)
{
exec
{
commandLine
(
"sass"
,
"src/main/resources/scss:src/main/resources/static/css"
)
}
}
else
{
File
(
"src/main/resources/scss"
).
listFiles
()
!!
.
filter
{
it
.
extension
==
"scss"
&&
!
it
.
name
.
startsWith
(
"_"
)
}.
forEach
{
exec
{
commandLine
(
"sassc"
,
"src/main/resources/scss/${it.name}"
,
"src/main/resources/static/css/${it.nameWithoutExtension}.css"
)
}
}
}
}
}
}
}
dependencies
{
dependencies
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment