Skip to content

Commit

Permalink
Beginning of Directory.Build.props settings
Browse files Browse the repository at this point in the history
Can create that file in the root with:

```
<Project>
  <PropertyGroup>
    <KspDir>/Users/lamont/ksp/plc_1.12.3</KspDir>
  </PropertyGroup>
</Project>
```

And it'll get passed into copy_build.sh

Or KSPDIR will override that setting

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
  • Loading branch information
lamont-granquist committed Dec 28, 2023
1 parent 31e97cc commit fab2471
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion MechJeb2/MechJeb2.csproj
Expand Up @@ -265,7 +265,7 @@
<Exec Command="call &quot;$(ProjectDir)copy_build.bat&quot; &quot;$(TargetPath)&quot; &quot;$(TargetDir)&quot; &quot;$(TargetName)&quot; &quot;$(ProjectDir)&quot;"/>
</Target>
<Target Name="AfterBuild" Condition=" '$(OS)' != 'Windows_NT' ">
<Exec Command="'$(ProjectDir)/copy_build.sh' '$(TargetPath)' '$(TargetDir)' '$(TargetName)' '$(ProjectDir)' '$(ReferencePath)'"/>
<Exec Command="'$(ProjectDir)/copy_build.sh' '$(TargetPath)' '$(TargetDir)' '$(TargetName)' '$(ProjectDir)' '$(KspDir)'"/>
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
11 changes: 1 addition & 10 deletions MechJeb2/copy_build.sh
Expand Up @@ -3,7 +3,7 @@ TARGET_PATH=$1
TARGET_DIR=$2
TARGET_NAME=$3
PROJECT_DIR=$4
REFERENCE_PATH=$5
KSPDIR=$5

if [ -z "${TARGET_PATH}" ] ; then
echo 'Expected $TARGET_PATH to be defined but it is not' >&2
Expand Down Expand Up @@ -31,15 +31,6 @@ if [ -z "${PROJECT_DIR}" ] ; then
exit 1
fi

if [ -z "${REFERENCE_PATH}" ] ; then
echo 'Expected REFERENCE_PATH to be defined but it is not' >&2
exit 1
fi

if [[ $(uname -s) = Darwin ]]; then
KSPDIR="$(dirname "$(dirname "$(dirname "$(dirname "$(dirname "$REFERENCE_PATH")")")")")"
fi

if [ -z "${KSPDIR}" ] ; then
if [[ $(uname -s) = Linux ]]; then
KSPDIR="${HOME}/.local/share/Steam/SteamApps/common/Kerbal Space Program"
Expand Down

0 comments on commit fab2471

Please sign in to comment.