Skip to content
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
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ output
*.user
*.sln.docstates
*.cache
.kotlin

# IDEs
/.idea/*.iml
Expand All @@ -21,4 +22,11 @@ output
.idea/shelf
.vs
_ReSharper*
_dotTrace*
_dotTrace*

# Nuget
packages/
**/NuGetLocks/*

# Example Mod
example-mod/.idea
9 changes: 9 additions & 0 deletions .idea/modules/rimworlddev.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions .idea/runConfigurations/Rider.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 2025.1.7
* Adds support for Rider 2026.1

## 2025.1.6
* Update the Rimworld Mod Template to support 1.6 by default

Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<SdkVersion>2025.3.*</SdkVersion>
<SdkVersion>2026.1.*</SdkVersion>

<Title>Rimworld Development Environment</Title>
<Description>Bring the intelligence of your IDE to Rimworld XML files. Use information backed by Rimworlds DLL file to autocomplete your XML, Ctrl+Click into the C# that your XML gets translated into and see what options you have when adding items in your mods!</Description>
Expand Down
116 changes: 37 additions & 79 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import com.jetbrains.plugin.structure.base.utils.isFile
import groovy.ant.FileNameFinder
import org.apache.tools.ant.taskdefs.condition.Os
import org.jetbrains.intellij.platform.gradle.Constants
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
import java.io.ByteArrayOutputStream
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("java")
alias(libs.plugins.kotlinJvm)
id("org.jetbrains.intellij.platform") version "2.5.0" // https://github.com/JetBrains/gradle-intellij-plugin/releases
id("me.filippov.gradle.jvm.wrapper") version "0.14.0"
id("org.jetbrains.intellij.platform") version "2.14.0" // https://github.com/JetBrains/gradle-intellij-plugin/releases
id("me.filippov.gradle.jvm.wrapper") version "0.16.0"
}


Expand Down Expand Up @@ -57,7 +55,7 @@ apply {
}

tasks.wrapper {
gradleVersion = "8.8"
gradleVersion = "9.4.1"
distributionType = Wrapper.DistributionType.ALL
distributionUrl =
"https://cache-redirector.jetbrains.com/services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
Expand All @@ -82,74 +80,28 @@ tasks.instrumentTestCode {
}

tasks.compileKotlin {
kotlinOptions { jvmTarget = "21" }
compilerOptions { jvmTarget.set(JvmTarget.JVM_21) }
}

val setBuildTool by tasks.registering {
doLast {
extra["executable"] = "dotnet"
var args = mutableListOf("msbuild")

if (isWindows) {
val stdout = ByteArrayOutputStream()
exec {
executable("${rootDir}\\tools\\vswhere.exe")
args("-latest", "-property", "installationPath", "-products", "*")
standardOutput = stdout
workingDir(rootDir)
}

val vsWhereDirectory = stdout.toString().trim()
if (vsWhereDirectory.isNotEmpty()) {
val files = FileNameFinder().getFileNames("${vsWhereDirectory}\\MSBuild", "**/MSBuild.exe")
extra["executable"] = files.get(0)
args = mutableListOf("/v:minimal")
} else {
val directory = "${System.getProperty("user.home")}\\AppData\\Local\\Programs\\Rider\\tools\\MSBuild"
if (directory.isNotEmpty()) {
val files = FileNameFinder().getFileNames(directory, "Current/Bin/MSBuild.exe")
extra["executable"] = files.get(0)
args = mutableListOf("/v:minimal")
}
}
}

args.add(DotnetSolution)
args.add("/p:Configuration=${BuildConfiguration}")
args.add("/p:HostFullIdentifier=")
extra["args"] = args
}
val compileDotNet by tasks.registering(Exec::class) {
executable("dotnet")
workingDir(rootDir)
args("build", "--consoleLoggerParameters:ErrorsOnly", "--configuration", "Release")
}

val compileDotNet by tasks.registering {
dependsOn(setBuildTool)
doLast {
val executable: String by setBuildTool.get().extra
val arguments = (setBuildTool.get().extra["args"] as List<String>).toMutableList()
arguments.add("/t:Restore;Rebuild")
exec {
executable(executable)
args(arguments)
workingDir(rootDir)
}
}
}
val buildResharperPlugin by tasks.registering(Exec::class) {
val arguments = mutableListOf<String>()
arguments.add("msbuild")
arguments.add(DotnetSolution)

val buildResharperPlugin by tasks.registering {
dependsOn(setBuildTool)
doLast {
val executable: String by setBuildTool.get().extra
val arguments = (setBuildTool.get().extra["args"] as List<String>).toMutableList()
arguments.add("/t:Restore;Rebuild;Pack")
arguments.add("/v:minimal")
arguments.add("/p:PackageOutputPath=\"$rootDir/output\"")
arguments.add("/p:PackageVersion=$PluginVersion")
exec {
executable(executable)
args(arguments)
workingDir(rootDir)
}
}
arguments.add("/t:Restore;Rebuild;Pack")
arguments.add("/v:minimal")
arguments.add("/p:PackageOutputPath=\"$rootDir/output\"")
arguments.add("/p:PackageVersion=$PluginVersion")

executable("dotnet")
args(arguments)
workingDir(rootDir)
}

tasks.buildPlugin {
Expand All @@ -163,7 +115,11 @@ tasks.buildPlugin {

dependencies {
intellijPlatform {
rider(ProductVersion, useInstaller = false)
rider(ProductVersion)
{
useInstaller = false
}

jetbrainsRuntime()

bundledPlugin("com.intellij.resharper.unity")
Expand All @@ -176,19 +132,25 @@ intellijPlatform {
freeArgs = listOf("-mute", "TemplateWordInPluginId")

ides {
ide(IntelliJPlatformType.Rider, ProductVersion)
// ide(IntelliJPlatformType.Rider, ProductVersion)
recommended()
}
}
}

tasks.runIde {
dependsOn(compileDotNet)

// Match Rider's default heap size of 1.5Gb (default for runIde is 512Mb)
maxHeapSize = "1500m"

// Rider's backend doesn't support dynamic plugins. It might be possible to work with auto-reload of the frontend
// part of a plugin, but there are dangers about keeping plugins in sync
autoReload = false

argumentProviders += CommandLineArgumentProvider {
listOf("${rootDir}/example-mod/AshAndDust.sln")
}
}

tasks.prepareSandbox {
Expand Down Expand Up @@ -223,14 +185,10 @@ tasks.prepareSandbox {
}
}

val testDotNet by tasks.registering {
doLast {
exec {
executable("dotnet")
args("test", DotnetSolution, "--logger", "GitHubActions")
workingDir(rootDir)
}
}
val testDotNet by tasks.registering(Exec::class) {
executable("dotnet")
args("test", DotnetSolution, "--logger", "GitHubActions")
workingDir(rootDir)
}

tasks.publishPlugin {
Expand Down
1 change: 1 addition & 0 deletions example-mod/.idea/.idea.AshAndDust/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions example-mod/.idea/.idea.AshAndDust/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions example-mod/.idea/.idea.AshAndDust/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions example-mod/.idea/.idea.AshAndDust/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added example-mod/1.4/Assemblies/AshAndDust.dll
Binary file not shown.
85 changes: 85 additions & 0 deletions example-mod/1.4/Defs/CannibalBurial/Building_CannibalFeast.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<Defs>
<ThingDef ParentName="BuildingBase">
<defName>CannibalFeast</defName>
<label>cannibal feast</label>
<description>An alter upon which the dead are placed to be consumed by their friends and family</description>
<ideoBuildingNamerBase>NamerCannibalPlatter</ideoBuildingNamerBase>
<thingClass>AshAndDust.Cannibal.Buildings.CannibalFeast</thingClass>
<drawerType>MapMeshAndRealTime</drawerType>
<graphicData>
<graphicClass>Graphic_Multi</graphicClass>
<texPath>Things/Building/CannibalAltar/CannibalAltar</texPath>
<shaderType>CutoutComplex</shaderType>
<drawSize>(2.5,1.665)</drawSize>
<shadowData>
<volume>(0.8, 1 ,0.8)</volume>
</shadowData>
</graphicData>
<size>(3,2)</size>
<costStuffCount>30</costStuffCount>
<stuffCategories>
<li>Woody</li>
<li>Metallic</li>
<li>Stony</li>
</stuffCategories>
<leaveResourcesWhenKilled>false</leaveResourcesWhenKilled>
<defaultPlacingRot>South</defaultPlacingRot>
<ritualFocus>
<spectateDistance>1~2</spectateDistance>
</ritualFocus>
<statBases>
<MaxHitPoints>50</MaxHitPoints>
<WorkToBuild>10000</WorkToBuild>
<Mass>25</Mass>
</statBases>
<terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
<passability>PassThroughOnly</passability>
<placeWorkers Inherit="False" />
<building>
<ai_chillDestination>false</ai_chillDestination>
<preventDeteriorationInside>true</preventDeteriorationInside>
<haulToContainerDuration>500</haulToContainerDuration>
<fullGraveGraphicData>
<texPath>Things/Building/CannibalAltar/CannibalAltar</texPath>
<shaderType>CutoutComplex</shaderType>
<graphicClass>Graphic_Multi</graphicClass>
<drawSize>(2.5,1.665)</drawSize>
<shadowData>
<volume>(0.8, 1 ,0.8)</volume>
</shadowData>
</fullGraveGraphicData>
<fixedStorageSettings>
<filter>
<categories>
<li>Corpses</li>
</categories>
</filter>
</fixedStorageSettings>
<defaultStorageSettings>
<priority>Important</priority>
<filter>
<categories>
<li>CorpsesHumanlike</li>
</categories>
<specialFiltersToDisallow>
<li>AllowCorpsesStranger</li>
</specialFiltersToDisallow>
</filter>
</defaultStorageSettings>
<destroySound>BuildingDestroyed_Wood_Small</destroySound>
</building>
<comps>
<li Class="CompProperties_AssignableToPawn">
<drawAssignmentOverlay>false</drawAssignmentOverlay>
<compClass>CompAssignableToPawn_Grave</compClass>
</li>
<li Class="AshAndDust.Utils.CompRequiresPrecept_Properties">
<OneOf>
<li>CannibalFuneral</li>
</OneOf>
</li>
</comps>
<designationCategory>Misc</designationCategory>
<designationHotKey>Misc9</designationHotKey>
</ThingDef>
</Defs>
17 changes: 17 additions & 0 deletions example-mod/1.4/Defs/CannibalBurial/Duties.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Defs>
<DutyDef>
<defName>EatAtCannibalFuneral</defName>
<hook>HighPriority</hook>
<thinkNode Class="ThinkNode_Priority">
<subNodes>
<li Class="AshAndDust.Cannibal.Jobs.EatAtFuneralGiver" />
</subNodes>
</thinkNode>
</DutyDef>

<JobDef>
<defName>EatAtCannibalFuneral</defName>
<driverClass>AshAndDust.Cannibal.Jobs.EatAtFuneralDriver</driverClass>
<reportString>eating at TargetA.</reportString>
</JobDef>
</Defs>
Loading
Loading