Compare commits

...

10 Commits

Author SHA1 Message Date
Jesse Brault
807556cd73 Update dependencies. 2025-06-01 14:43:44 -05:00
Jesse Brault
ab5b678920 Fix bug with compileUnit not seeing all ssg-gradle found classpath. 2025-05-31 23:07:06 -05:00
Jesse Brault
82a8be76b5 Work on 0.5.0-SNAPSHOT; various updates and such. 2025-05-31 20:43:40 -05:00
Jesse Brault
4757a2e9a5 Delete old test-ssg-project which was causing problems. 2025-05-31 20:08:56 -05:00
Jesse Brault
3170d2b2e9 Drop redundant 'ssg' from Maven coordinates. 2025-02-16 18:27:43 -06:00
Jesse Brault
57fa73f4c3 Set to 0.4.3-SNAPSHOT. 2025-02-16 18:25:42 -06:00
Jesse Brault
1799db2e37 Upgrade groowt and groovy dependencies. 2025-02-16 18:13:41 -06:00
Jesse Brault
753f3b67b1 Updated to Gradle 8.9 and jbarchiva 0.2.2. 2024-07-17 14:56:50 -05:00
JesseBrault0709
894bd55033 Added a todo. 2024-06-14 15:18:16 +02:00
JesseBrault0709
8355ec548b Added a todo. 2024-06-14 12:52:02 +02:00
32 changed files with 118 additions and 553 deletions

View File

@ -1,16 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="debug-test-project" type="Remote">
<module name="ssg" />
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" />
<option name="HOST" value="localhost" />
<option name="PORT" value="8192" />
<option name="AUTO_RESTART" value="false" />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="8192" />
<option name="LOCAL" value="false" />
</RunnerSettings>
<method v="2" />
</configuration>
</component>

View File

@ -1,19 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="launch-debug-test-project" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/test-ssg-project/bin/ssg" />
<option name="SCRIPT_OPTIONS" value="--debug build -g --dry-run -b default" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$/test-ssg-project" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/usr/bin/env" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="true" />
<envs />
<method v="2">
<option name="Gradle.BeforeRunTask" enabled="true" tasks="publishToMavenLocal" externalProjectPath="$PROJECT_DIR$" vmOptions="" scriptParameters="" />
</method>
</configuration>
</component>

View File

@ -1,19 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="run-test-project" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/test-ssg-project/bin/ssg" />
<option name="SCRIPT_OPTIONS" value="build --log-level=debug --gradle --dry-run --build default" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$/test-ssg-project" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/usr/bin/env" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="false" />
<option name="EXECUTE_SCRIPT_FILE" value="true" />
<envs />
<method v="2">
<option name="Gradle.BeforeRunTask" enabled="true" tasks="publishToMavenLocal" externalProjectPath="$PROJECT_DIR$" vmOptions="" scriptParameters="" />
</method>
</configuration>
</component>

16
README.md Normal file
View File

@ -0,0 +1,16 @@
# Static Site Generator (SSG)
## Updating Gradle
Update the Gradle wrapper via `gradle/wrapper/gradle-wrapper.properties`. Make sure that the tooling-api dependency is
updated to the same version in `cli/build.gradle`.
## Version-bumping
Update the version of the project in `buildSrc/src/main/groovy/ssg-common.gradle`. Then update the references to the
`cli` and `api` projects in `ssg-gradle-plugin/src/main/java/com/jessebrault/ssg/gradle/SsgGradlePlugin.java`.
## Publishing
Gradle command `publishAllPublicationsToJbArchiva<Internal|Snapshots>Repository`. Which one of `internal` or `snapshots`
appears depends on the current version.

View File

@ -17,6 +17,8 @@ program with the incorporation of Groowt and Web View Components.
- [ ] Think about abstracting the build tool logic, because all we need
really is the URLs/Paths for the classes/jars of components and resources
- [ ] Document new api and usage.
- [ ] Re-incorporate dist plugin in gradle build of cli/api
- [ ] Think about how these might be used without a gradle project backing
## 0.4.3
- [ ] `Text` component for simply rendering Text objects. Can be used as such:
@ -29,6 +31,7 @@ program with the incorporation of Groowt and Web View Components.
- [ ] `ModelFactory` for creating models, and `TextModelFactory` for creating models from texts.
- [ ] `Model` component for rendering a model with either a supplied renderer, or a registered `ModelRenderer`
- [ ] `Global` component for rendering globals.
- [ ] Automatically inject self PageSpec and path to Pages.
## 0.4.1
- [x] Update groowt to 0.1.2.

View File

@ -8,7 +8,6 @@ plugins {
repositories {
mavenCentral()
mavenLocal()
}
configurations {
@ -20,7 +19,12 @@ configurations {
dependencies {
api libs.groovy
api libs.groovy.yaml
api libs.groowt.all
api libs.groowt.v
api libs.groowt.vc
api libs.groowt.wvc
api libs.groowt.fp
api libs.groowt.di
compileOnlyApi libs.jetbrains.anontations
@ -29,7 +33,7 @@ dependencies {
implementation libs.commonmark.frontmatter
implementation libs.jsoup
runtimeOnly libs.groowt.wvcCompiler
runtimeOnly libs.groowt.wvcc
}
java {
@ -43,7 +47,7 @@ jar {
publishing {
publications {
create('ssgApi', MavenPublication) {
artifactId = 'ssg-api'
artifactId = 'api'
from components.java
}
}

View File

@ -19,7 +19,6 @@ import groovy.transform.TupleConstructor
import groowt.util.di.ObjectFactory
import groowt.util.di.RegistryObjectFactory
import groowt.util.fp.option.Option
import groowt.view.component.compiler.DefaultComponentTemplateCompilerConfiguration
import groowt.view.component.compiler.SimpleComponentTemplateClassFactory
import groowt.view.component.factory.ComponentFactories
import groowt.view.component.web.DefaultWebViewComponentContext
@ -72,10 +71,7 @@ class DefaultStaticSiteGenerator implements StaticSiteGenerator {
}
protected WvcCompiler getWvcCompiler() {
def wvcCompilerConfiguration = new DefaultComponentTemplateCompilerConfiguration()
wvcCompilerConfiguration.groovyClassLoader = this.groovyClassLoader
def templateClassFactory = new SimpleComponentTemplateClassFactory(this.groovyClassLoader)
new WvcCompiler(wvcCompilerConfiguration, templateClassFactory)
new WvcCompiler(this.groovyClassLoader, new SimpleComponentTemplateClassFactory(this.groovyClassLoader))
}
protected WebViewComponentContext makeContext(

View File

@ -6,14 +6,28 @@ import groowt.util.fp.either.Either
import groowt.view.component.ComponentTemplate
import groowt.view.component.ViewComponent
import groowt.view.component.compiler.ComponentTemplateClassFactory
import groowt.view.component.compiler.ComponentTemplateCompilerConfiguration
import groowt.view.component.compiler.source.ComponentTemplateSource
import groowt.view.component.web.compiler.DefaultWebViewComponentTemplateCompileUnit
@TupleConstructor
class WvcCompiler {
final ComponentTemplateCompilerConfiguration compilerConfiguration
private static class SsgWvcTemplateCompileUnit extends DefaultWebViewComponentTemplateCompileUnit {
SsgWvcTemplateCompileUnit(
String descriptiveName,
Class<? extends ViewComponent> forClass,
ComponentTemplateSource source,
String defaultPackageName,
GroovyClassLoader groovyClassLoader
) {
super(descriptiveName, forClass, source, defaultPackageName)
this.groovyCompilationUnit.setClassLoader(groovyClassLoader)
}
}
final GroovyClassLoader groovyClassLoader
final ComponentTemplateClassFactory templateClassFactory
Either<Diagnostic, ComponentTemplate> compileTemplate(
@ -27,13 +41,14 @@ class WvcCompiler {
))
}
def source = ComponentTemplateSource.of(templateUrl)
def compileUnit = new DefaultWebViewComponentTemplateCompileUnit(
def compileUnit = new SsgWvcTemplateCompileUnit(
source.descriptiveName,
componentClass,
source,
componentClass.packageName
componentClass.packageName,
this.groovyClassLoader
)
def compileResult = compileUnit.compile(compilerConfiguration)
def compileResult = compileUnit.compile()
def templateClass = templateClassFactory.getTemplateClass(compileResult)
def componentTemplate = templateClass.getConstructor().newInstance()
return Either.right(componentTemplate)

View File

@ -23,5 +23,5 @@ repositories {
}
dependencies {
implementation 'com.jessebrault.jbarchiva:jbarchiva:0.1.0'
implementation 'com.jessebrault.jbarchiva:jbarchiva:0.2.2'
}

View File

@ -4,7 +4,7 @@ plugins {
}
group 'com.jessebrault.ssg'
version '0.4.2'
version '0.5.0-SNAPSHOT'
repositories {
mavenCentral()

View File

@ -8,7 +8,6 @@ plugins {
repositories {
mavenCentral()
maven { url 'https://repo.gradle.org/gradle/libs-releases' }
mavenLocal()
}
dependencies {
@ -17,7 +16,7 @@ dependencies {
implementation libs.picocli
implementation libs.log4j2.api
implementation libs.log4j2.core
implementation "org.gradle:gradle-tooling-api:8.7"
implementation "org.gradle:gradle-tooling-api:8.14.1"
runtimeOnly libs.log4j2.slf4j2.impl
}
@ -45,7 +44,7 @@ distributions {
publishing {
publications {
create('ssgCli', MavenPublication) {
artifactId = 'ssg-cli'
artifactId = 'cli'
from components.java
}
}

View File

@ -1,26 +1,35 @@
[versions]
commonmark = '0.22.0'
groovy = '4.0.21'
groowt = '0.1.2'
log4j2 = '2.23.1'
mockito = '5.12.0'
junit = '5.10.2'
classgraph = '4.8.179'
commonmark = '0.24.0'
groovy = '4.0.27'
groowt = '0.1.4'
jetbrains-annotations = '26.0.2'
jsoup = '1.20.1'
junit = '5.13.0'
log4j2 = '2.24.3'
mockito = '5.18.0'
picocli = '4.7.7'
slf4j = '2.0.17'
[libraries]
classgraph = 'io.github.classgraph:classgraph:4.8.172'
classgraph = { module = 'io.github.classgraph:classgraph', version.ref = 'classgraph' }
commonmark = { module = 'org.commonmark:commonmark', version.ref = 'commonmark' }
commonmark-frontmatter = { module = 'org.commonmark:commonmark-ext-yaml-front-matter', version.ref = 'commonmark' }
groovy = { module = 'org.apache.groovy:groovy', version.ref = 'groovy' }
groovy-yaml = { module = 'org.apache.groovy:groovy-yaml', version.ref = 'groovy' }
groowt-all = { module = 'groowt:groowt-all', version.ref = 'groowt' }
groowt-wvcCompiler = { module = 'groowt:web-view-components-compiler', version.ref = 'groowt' }
jetbrains-anontations = 'org.jetbrains:annotations:24.1.0'
jsoup = 'org.jsoup:jsoup:1.17.2'
groowt-v = { module = 'groowt:views', version.ref = 'groowt' }
groowt-vc = { module = 'groowt:view-components', version.ref = 'groowt' }
groowt-wvc= { module = 'groowt:web-view-components', version.ref = 'groowt' }
groowt-wvcc = { module = 'groowt:web-view-components-compiler', version.ref = 'groowt' }
groowt-fp = { module = 'groowt:util-fp', version.ref = 'groowt' }
groowt-di = { module = 'groowt:util-di', version.ref = 'groowt' }
jetbrains-anontations = { module = 'org.jetbrains:annotations', version.ref = 'jetbrains-annotations' }
jsoup = { module = 'org.jsoup:jsoup', version.ref = 'jsoup' }
junit-jupiter-api = { module = 'org.junit.jupiter:junit-jupiter-api', version.ref = 'junit' }
log4j2-api = { module = 'org.apache.logging.log4j:log4j-api', version.ref = 'log4j2' }
log4j2-core = { module = 'org.apache.logging.log4j:log4j-core', version.ref = 'log4j2' }
log4j2-slf4j2-impl = { module = 'org.apache.logging.log4j:log4j-slf4j2-impl', version.ref = 'log4j2' }
mockito-core = { module = 'org.mockito:mockito-core', version.ref = 'mockito' }
mockito-junit-jupiter = { module = 'org.mockito:mockito-junit-jupiter', version.ref = 'mockito' }
picocli = 'info.picocli:picocli:4.7.6'
slf4j-api = 'org.slf4j:slf4j-api:2.0.13'
picocli = { module = 'info.picocli:picocli', version.ref = 'picocli' }
slf4j-api = { module = 'org.slf4j:slf4j-api', version.ref = 'slf4j' }

Binary file not shown.

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

6
gradlew vendored
View File

@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

2
gradlew.bat vendored
View File

@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################

View File

@ -162,8 +162,8 @@ public class SsgGradlePlugin implements Plugin<Project> {
Configuration ssgApiConfiguration,
Configuration ssgCliConfiguration
) {
final Dependency ssgApi = project.getDependencies().create("com.jessebrault.ssg:ssg-api:0.4.2");
final Dependency ssgCli = project.getDependencies().create("com.jessebrault.ssg:ssg-cli:0.4.2");
final Dependency ssgApi = project.getDependencies().create("com.jessebrault.ssg:api:0.5.0-SNAPSHOT");
final Dependency ssgCli = project.getDependencies().create("com.jessebrault.ssg:cli:0.5.0-SNAPSHOT");
ssgApiConfiguration.getDependencies().add(ssgApi);
ssgCliConfiguration.getDependencies().add(ssgCli);
}

View File

@ -0,0 +1,35 @@
package com.jessebrault.ssg.gradle;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.io.TempDir;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
/**
* This is just a scaffolding test file for the future.
*/
public class SsgGradlePluginTests {
@TempDir
private Path tempDir;
private Path buildFile;
@BeforeEach
public void beforeEach() throws IOException {
buildFile = tempDir.resolve("build.gradle");
Files.writeString(buildFile, """
plugins {
id 'com.jessebrault.ssg'
}
dependencies {
implementation 'org.apache.groovy:groovy:4.0.25'
}
"""
);
}
}

View File

@ -1,5 +0,0 @@
bin
.ssg
testBuild
dist
default

View File

@ -1,19 +0,0 @@
plugins {
id 'com.jessebrault.ssg' version '0.4.2'
}
dependencies {
implementation 'org.apache.groovy:groovy:4.0.21'
}
repositories {
mavenCentral()
maven {
url 'https://archiva.jessebrault.com/repository/internal/'
credentials {
username System.getenv('JBARCHIVA_USERNAME')
password System.getenv('JBARCHIVA_PASSWORD')
}
}
}

View File

@ -1,14 +0,0 @@
package com.jessebrault.site
import groowt.view.component.web.BaseWebViewComponent
class Head extends BaseWebViewComponent {
final String title
Head(Map attr) {
super(Head.getResource('HeadTemplate.wvc'))
this.title = attr.title
}
}

View File

@ -1,6 +0,0 @@
---
package com.jessebrault.site
---
<head>
<title>$title</title>
</head>

View File

@ -1,7 +0,0 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@ -1,249 +0,0 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

View File

@ -1,92 +0,0 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@ -1,21 +0,0 @@
package com.jessebrault.site
import com.jessebrault.ssg.di.InjectText
import com.jessebrault.ssg.page.PageSpec
import com.jessebrault.ssg.text.Text
import com.jessebrault.ssg.view.WvcPageView
import jakarta.inject.Inject
@PageSpec(name = 'Biography', path = '/biography')
class Biography extends WvcPageView {
static final String greeting = 'Hello, World!'
final Text biographyText
@Inject
Biography(@InjectText('/Biography.md') Text biographyText) {
this.biographyText = biographyText
}
}

View File

@ -1,14 +0,0 @@
---
package com.jessebrault.site
---
<html lang="en">
<Head title={pageTitle} />
<body>
<h1>$pageTitle</h1>
<h2>$url</h2>
<p>$greeting</p>
<section>
<%= biographyText.render() %>
</section>
</body>
</html>

View File

@ -1,7 +0,0 @@
---
package com.jessebrault.site
---
$pageTitle
$url
Hello, World!

View File

@ -1,15 +0,0 @@
pluginManagement {
repositories {
mavenCentral()
maven {
url 'https://archiva.jessebrault.com/repository/internal/'
credentials {
username System.getenv('JBARCHIVA_USERNAME')
password System.getenv('JBARCHIVA_PASSWORD')
}
}
}
}
rootProject.name = 'test-ssg-project'

View File

@ -1,10 +0,0 @@
import com.jessebrault.ssg.buildscript.BuildScriptBase
import groovy.transform.BaseScript
@BaseScript
BuildScriptBase base
build {
siteName 'My Test Site'
baseUrl 'https://hello.com'
}

View File

@ -1,3 +0,0 @@
# Biography
Hello! My name is Jesse Brault.