Skip to content
This repository has been archived by the owner on Jun 14, 2022. It is now read-only.

Commit

Permalink
Switched to platform app instead
Browse files Browse the repository at this point in the history
Uses multiple project.json's instead
Haven't tested the shell script again
  • Loading branch information
CameronAavik committed Jan 6, 2017
1 parent 1318421 commit eca87f1
Show file tree
Hide file tree
Showing 8 changed files with 125 additions and 49 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.*~
bin/
obj/
out/
project.lock.json
.DS_Store
*.pyc
Expand Down
22 changes: 22 additions & 0 deletions build_jsons/project.linux.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true,
"define": [
"LINUX"
]
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
},
"publishOptions": {
"includeFiles": "libglfw.so"
}
}
22 changes: 22 additions & 0 deletions build_jsons/project.osx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true,
"define": [
"OSX"
]
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
},
"publishOptions": {
"includeFiles": "libglfw.dylib"
}
}
22 changes: 22 additions & 0 deletions build_jsons/project.windows.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true,
"define": [
"WINDOWS"
]
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
},
"publishOptions": {
"includeFiles": "glfw.dll"
}
}
12 changes: 4 additions & 8 deletions project.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,11 @@
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"System.Runtime.InteropServices": "4.1.0",
"Microsoft.NETCore.DotNetHostPolicy": "1.0.1",
"Microsoft.NETCore.Runtime.CoreCLR": "1.0.4"
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
},
"runtimes": {
"win10-x64": {},
"osx.10.10-x64": {},
"ubuntu.14.04-x64": {}
}
}
27 changes: 0 additions & 27 deletions publish.bat

This file was deleted.

27 changes: 27 additions & 0 deletions publish.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
:: Clean output directory
rmdir /s /q out

:: Back up the current project.json
ren project.json project.json.bak

:: Windows
copy "build_jsons\project.windows.json" "project.json"
dotnet restore
dotnet publish -c Release -o "out\windows"
del project.json

:: OSX
copy "build_jsons\project.osx.json" "project.json"
dotnet restore
dotnet publish -c Release -o "out\osx"
del project.json

:: Linux
copy "build_jsons\project.linux.json" "project.json"
dotnet restore
dotnet publish -c Release -o "out\linux"
del project.json

:: Restore backup
ren project.json.bak project.json
dotnet restore
41 changes: 27 additions & 14 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
mv Program.cs Program.cs.temp
echo "#define WINDOWS" | cat - Program.cs.temp > Program.cs
dotnet publish -c Release -r win10-x64
rm Program.cs
echo "#define OSX" | cat - Program.cs.temp > Program.cs
dotnet publish -c Release -r osx.10.10-x64
rm Program.cs
echo "#define LINUX" | cat - Program.cs.temp > Program.cs
dotnet publish -c Release -r ubuntu.14.04-x64
rm Program.cs
mv Program.cs.temp Program.cs
cp "glfw.dll" "./bin/Release/netcoreapp1.0/win10-x64/publish"
cp "libglfw.dylib" "./bin/Release/netcoreapp1.0/osx.10.10-x64/publish"
cp "libglfw.so" "./bin/Release/netcoreapp1.0/ubuntu.14.04-x64/publish"
# Clean output directory
rm -rf out

# Back up the current project.json
mv project.json project.json.bak

# Windows
cp "/build_jsons/project.windows.json" "project.json"
dotnet restore
dotnet publish -c Release -o "out/windows"
rm project.json

# OSX
cp "/build_jsons/project.osx.json" "project.json"
dotnet restore
dotnet publish -c Release -o "out/osx"
rm project.json

# Linux
cp "/build_jsons/project.linux.json" "project.json"
dotnet restore
dotnet publish -c Release -o "out/linux"
rm project.json

# Restore backup
mv project.json.bak project.json
dotnet restore

0 comments on commit eca87f1

Please sign in to comment.