diff --git a/src/Castle.MonoRail.Views.Spark.Tests/Castle.MonoRail.Views.Spark.Tests.csproj b/src/Castle.MonoRail.Views.Spark.Tests/Castle.MonoRail.Views.Spark.Tests.csproj
index 2261e90a..2ac78745 100644
--- a/src/Castle.MonoRail.Views.Spark.Tests/Castle.MonoRail.Views.Spark.Tests.csproj
+++ b/src/Castle.MonoRail.Views.Spark.Tests/Castle.MonoRail.Views.Spark.Tests.csproj
@@ -4,6 +4,8 @@
net48
AllRules.ruleset
False
+ true
+ true
@@ -26,10 +28,10 @@
-
-
-
-
+
+
+
+
diff --git a/src/Castle.Monorail.Pdf.Tests/Castle.Monorail.Pdf.Tests.csproj b/src/Castle.Monorail.Pdf.Tests/Castle.Monorail.Pdf.Tests.csproj
index a0907456..9f13eac9 100644
--- a/src/Castle.Monorail.Pdf.Tests/Castle.Monorail.Pdf.Tests.csproj
+++ b/src/Castle.Monorail.Pdf.Tests/Castle.Monorail.Pdf.Tests.csproj
@@ -20,9 +20,9 @@
-
-
-
+
+
+
diff --git a/src/Spark.Python.Tests/Spark.Python.Tests.csproj b/src/Spark.Python.Tests/Spark.Python.Tests.csproj
index 8e40e317..dabe7593 100644
--- a/src/Spark.Python.Tests/Spark.Python.Tests.csproj
+++ b/src/Spark.Python.Tests/Spark.Python.Tests.csproj
@@ -20,8 +20,8 @@
-
-
+
+
diff --git a/src/Spark.Ruby.Tests/Spark.Ruby.Tests.csproj b/src/Spark.Ruby.Tests/Spark.Ruby.Tests.csproj
index bda202a8..04459c71 100644
--- a/src/Spark.Ruby.Tests/Spark.Ruby.Tests.csproj
+++ b/src/Spark.Ruby.Tests/Spark.Ruby.Tests.csproj
@@ -24,8 +24,8 @@
-
-
+
+
diff --git a/src/Spark.Tests/Spark.Tests.csproj b/src/Spark.Tests/Spark.Tests.csproj
index d271f45a..6c2549ee 100644
--- a/src/Spark.Tests/Spark.Tests.csproj
+++ b/src/Spark.Tests/Spark.Tests.csproj
@@ -15,10 +15,10 @@
-
-
-
-
+
+
+
+
diff --git a/src/Spark.Web.Mvc.Pdf.Tests/Spark.Web.Mvc.Pdf.Tests.csproj b/src/Spark.Web.Mvc.Pdf.Tests/Spark.Web.Mvc.Pdf.Tests.csproj
index d20feaf8..5adfdc1a 100644
--- a/src/Spark.Web.Mvc.Pdf.Tests/Spark.Web.Mvc.Pdf.Tests.csproj
+++ b/src/Spark.Web.Mvc.Pdf.Tests/Spark.Web.Mvc.Pdf.Tests.csproj
@@ -4,15 +4,17 @@
net48
AllRules.ruleset
False
+ true
+ true
-
-
-
+
+
+
diff --git a/src/Spark.Web.Mvc.Ruby.Tests/Spark.Web.Mvc.Ruby.Tests.csproj b/src/Spark.Web.Mvc.Ruby.Tests/Spark.Web.Mvc.Ruby.Tests.csproj
index 609f2bf7..23253f1a 100644
--- a/src/Spark.Web.Mvc.Ruby.Tests/Spark.Web.Mvc.Ruby.Tests.csproj
+++ b/src/Spark.Web.Mvc.Ruby.Tests/Spark.Web.Mvc.Ruby.Tests.csproj
@@ -4,6 +4,8 @@
net48
AllRules.ruleset
False
+ true
+ true
@@ -13,8 +15,8 @@
-
-
+
+
diff --git a/src/Spark.Web.Mvc.Tests/Spark.Web.Mvc.Tests.csproj b/src/Spark.Web.Mvc.Tests/Spark.Web.Mvc.Tests.csproj
index 2667033a..5671e1c3 100644
--- a/src/Spark.Web.Mvc.Tests/Spark.Web.Mvc.Tests.csproj
+++ b/src/Spark.Web.Mvc.Tests/Spark.Web.Mvc.Tests.csproj
@@ -4,14 +4,16 @@
net48
AllRules.ruleset
False
+ true
+ true
-
-
+
+
diff --git a/src/Spark.Web.Tests/Spark.Web.Tests.csproj b/src/Spark.Web.Tests/Spark.Web.Tests.csproj
index 7cd4f447..d71bda42 100644
--- a/src/Spark.Web.Tests/Spark.Web.Tests.csproj
+++ b/src/Spark.Web.Tests/Spark.Web.Tests.csproj
@@ -5,6 +5,8 @@
AllRules.ruleset
Spark
False
+ true
+ true
@@ -14,10 +16,11 @@
-
-
-
-
+
+
+
+
+
diff --git a/src/Spark/Spark.csproj b/src/Spark/Spark.csproj
index 8b8916f3..6fe83070 100644
--- a/src/Spark/Spark.csproj
+++ b/src/Spark/Spark.csproj
@@ -1,7 +1,8 @@
Library
- net48;net8.0;netstandard2.0
+ net48;net8.0
+ latest
AllRules.ruleset
False
..\SparkKey.snk
diff --git a/src/Spark/SparkSettings.cs b/src/Spark/SparkSettings.cs
index 1732add0..8434656a 100644
--- a/src/Spark/SparkSettings.cs
+++ b/src/Spark/SparkSettings.cs
@@ -21,8 +21,22 @@ namespace Spark
{
public class SparkSettings : ISparkSettings
{
- public SparkSettings()
+ ///
+ /// Default constructor.
+ ///
+ public SparkSettings() : this(null)
+ {
+ RootPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
+ }
+
+ ///
+ /// Constructor that lets you specify the .
+ ///
+ /// The path of the web app folder (the one containing the Views folder)
+ public SparkSettings(string rootPath)
{
+ RootPath = rootPath;
+
_useNamespaces = new List();
_useAssemblies = new List();
_resourceMappings = new List();
@@ -34,9 +48,9 @@ public SparkSettings()
}
///
- /// Depending on the target framework this value must be determined (E.g. AppDomain.CurrentDomain.SetupInformation.ApplicationBase in .net framework) or set.
+ /// The path of the web app folder (the one containing the Views folder).
///
- public string RootPath => AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
+ public string RootPath { get; set; }
public bool Debug { get; set; }
public NullBehaviour NullBehaviour { get; set; }
@@ -64,24 +78,28 @@ public SparkSettings()
public SparkSettings SetDebug(bool debug)
{
Debug = debug;
+
return this;
}
public SparkSettings SetAutomaticEncoding(bool automaticEncoding)
{
AutomaticEncoding = automaticEncoding;
+
return this;
}
public SparkSettings SetStatementMarker(string statementMarker)
{
StatementMarker = statementMarker;
+
return this;
}
public SparkSettings SetNullBehaviour(NullBehaviour nullBehaviour)
{
NullBehaviour = nullBehaviour;
+
return this;
}
@@ -93,18 +111,31 @@ public SparkSettings SetNullBehaviour(NullBehaviour nullBehaviour)
public SparkSettings SetPageBaseType(string typeName)
{
PageBaseType = typeName;
+
return this;
}
+ ///
+ /// Sets the type each spark page should inherit from.
+ ///
+ /// The type.
+ ///
public SparkSettings SetPageBaseType(Type type)
{
PageBaseType = type.FullName;
+
return this;
}
+ ///
+ /// Specifies the the spark view should be compiled to.
+ ///
+ ///
+ ///
public SparkSettings SetDefaultLanguage(LanguageType language)
{
DefaultLanguage = language;
+
return this;
}
@@ -116,36 +147,42 @@ public SparkSettings SetDefaultLanguage(LanguageType language)
public SparkSettings AddAssembly(string assembly)
{
_useAssemblies.Add(assembly);
+
return this;
}
public SparkSettings AddAssembly(Assembly assembly)
{
_useAssemblies.Add(assembly.FullName);
+
return this;
}
public SparkSettings AddNamespace(string ns)
{
_useNamespaces.Add(ns);
+
return this;
}
public SparkSettings SetPrefix(string prefix)
{
Prefix = prefix;
+
return this;
}
public SparkSettings SetParseSectionTagAsSegment(bool parseSectionTagAsSegment)
{
ParseSectionTagAsSegment = parseSectionTagAsSegment;
+
return this;
}
public SparkSettings SetAttributeBehaviour(AttributeBehaviour attributeBehaviour)
{
AttributeBehaviour = attributeBehaviour;
+
return this;
}
@@ -157,6 +194,7 @@ public SparkSettings AddResourceMapping(string match, string replace)
public SparkSettings AddResourceMapping(string match, string replace, bool stopProcess)
{
_resourceMappings.Add(new SimpleResourceMapping { Match = match, Location = replace, Stop = stopProcess });
+
return this;
}
@@ -168,6 +206,7 @@ public SparkSettings AddViewFolder(Type customType, IDictionary
Type = customType.AssemblyQualifiedName,
Parameters = parameters
});
+
return this;
}
}