diff --git a/.travis.yml b/.travis.yml index 43140100e9..ee87d72f27 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,12 +5,15 @@ language: c # Make sure build dependencies are installed. +before_install: + - sudo apt-get update install: - - sudo apt-get update && sudo apt-get install mono-gmcs cli-common-dev libsdl1.2debian libgl1-mesa-glx libopenal1 libfreetype6 + - sudo apt-get install mono-gmcs cli-common-dev libsdl1.2debian libgl1-mesa-glx libopenal1 libfreetype6 # Run the build script which will automatically call RALint and ensure that the IDE project files are still valid. script: - make all + - make test - xbuild # Only watch the development branch. diff --git a/Makefile b/Makefile index 41078e5e09..8442ab00db 100644 --- a/Makefile +++ b/Makefile @@ -6,12 +6,21 @@ # to compile with development tools, run: # make all # +# to check the official mods for erroneous yaml files, run: +# make test +# +# to generate documentation aimed at modders, run: +# make docs +# # to install, run: # make [prefix=/foo] [bindir=/bar/bin] install # # to install with development tools, run: # make [prefix=/foo] [bindir=/bar/bin] install-all # +# to install Linux desktop files and icons: +# make install-shortcuts +# # to uninstall, run: # make uninstall # @@ -134,7 +143,6 @@ mod_ra_TARGET = mods/ra/OpenRA.Mods.RA.dll mod_ra_KIND = library mod_ra_DEPS = $(STD_MOD_DEPS) $(utility_TARGET) $(geoip_TARGET) mod_ra_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(utility_TARGET) $(geoip_TARGET) -mod_ra_EXTRA_CMDS = mono --debug RALint.exe ra PROGRAMS += mod_ra mod_ra: $(mod_ra_TARGET) @@ -144,7 +152,6 @@ mod_cnc_TARGET = mods/cnc/OpenRA.Mods.Cnc.dll mod_cnc_KIND = library mod_cnc_DEPS = $(STD_MOD_DEPS) $(mod_ra_TARGET) mod_cnc_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_ra_TARGET) -mod_cnc_EXTRA_CMDS = mono --debug RALint.exe cnc PROGRAMS += mod_cnc mod_cnc: $(mod_cnc_TARGET) @@ -154,7 +161,6 @@ mod_d2k_TARGET = mods/d2k/OpenRA.Mods.D2k.dll mod_d2k_KIND = library mod_d2k_DEPS = $(STD_MOD_DEPS) $(mod_ra_TARGET) $(mod_cnc_TARGET) mod_d2k_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_ra_TARGET) -mod_d2k_EXTRA_CMDS = mono --debug RALint.exe d2k PROGRAMS += mod_d2k mod_d2k: $(mod_d2k_TARGET) @@ -164,7 +170,6 @@ mod_ts_TARGET = mods/ts/OpenRA.Mods.TS.dll mod_ts_KIND = library mod_ts_DEPS = $(STD_MOD_DEPS) $(mod_ra_TARGET) mod_ts_LIBS = $(COMMON_LIBS) $(STD_MOD_LIBS) $(mod_ra_TARGET) -mod_ts_EXTRA_CMDS = mono --debug RALint.exe ts PROGRAMS += mod_ts mod_ts: $(mod_ts_TARGET) @@ -187,14 +192,24 @@ OpenRA.Editor.Form1.resources: editor: OpenRA.Editor.MapSelect.resources OpenRA.Editor.Form1.resources $(editor_TARGET) # Analyses mod yaml for easy to detect errors -ralint_SRCS := $(shell find RALint/ -iname '*.cs') -ralint_TARGET = RALint.exe +ralint_SRCS := $(shell find OpenRA.Lint/ -iname '*.cs') +ralint_TARGET = OpenRA.Lint.exe ralint_KIND = exe ralint_DEPS = $(fileformats_TARGET) $(game_TARGET) ralint_LIBS = $(COMMON_LIBS) $(ralint_DEPS) PROGRAMS += ralint ralint: $(ralint_TARGET) +test: + @mono --debug OpenRA.Lint.exe ra + @echo "OpenRA.Lint: ra mod yaml checks passed." + @mono --debug OpenRA.Lint.exe cnc + @echo "OpenRA.Lint: cnc mod yaml checks passed." + @mono --debug OpenRA.Lint.exe d2k + @echo "OpenRA.Lint: d2k mod yaml checks passed." + @mono --debug OpenRA.Lint.exe ts + @echo "OpenRA.Lint: ts mod yaml checks passed." + # Builds and exports tilesets from a bitmap tsbuild_SRCS := $(shell find OpenRA.TilesetBuilder/ -iname '*.cs') tsbuild_TARGET = OpenRA.TilesetBuilder.exe @@ -218,8 +233,8 @@ tsbuild: OpenRA.TilesetBuilder.FormBuilder.resources OpenRA.TilesetBuilder.FormN utility_SRCS := $(shell find OpenRA.Utility/ -iname '*.cs') utility_TARGET = OpenRA.Utility.exe utility_KIND = exe -utility_DEPS = $(fileformats_TARGET) $(game_TARGET) -utility_LIBS = $(COMMON_LIBS) $(utility_DEPS) thirdparty/ICSharpCode.SharpZipLib.dll System.Windows.Forms.dll +utility_DEPS = $(fileformats_TARGET) $(game_TARGET) +utility_LIBS = $(COMMON_LIBS) $(utility_DEPS) thirdparty/ICSharpCode.SharpZipLib.dll System.Windows.Forms.dll PROGRAMS += utility utility: $(utility_TARGET) @@ -318,10 +333,8 @@ install-core: default @echo 'DATADIR="$${ROOTDIR}/'"$(datadir)"'"' >> openra @echo 'cd "$${DATADIR}/openra"' >> openra @echo 'exec mono OpenRA.Game.exe "$$@"' >> openra - @$(INSTALL_DIR) "$(BIN_INSTALL_DIR)" @$(INSTALL_PROGRAM) -m +rx openra "$(BIN_INSTALL_DIR)" - @-$(RM) openra install-tools: tools @@ -335,16 +348,33 @@ install-tools: tools @echo 'DATADIR="$${ROOTDIR}/'"$(datadir)"'"' >> openra-editor @echo 'cd "$${DATADIR}/openra"' >> openra-editor @echo 'exec mono OpenRA.Editor.exe "$$@"' >> openra-editor - @$(INSTALL_DIR) "$(BIN_INSTALL_DIR)" @$(INSTALL_PROGRAM) -m +rx openra-editor "$(BIN_INSTALL_DIR)" - @-$(RM) openra-editor +install-shortcuts: shortcuts + @$(INSTALL_DIR) "$(DESTDIR)$(datadir)/icons/" + @$(CP_R) packaging/linux/hicolor/ "$(DESTDIR)$(datadir)/icons" + + @$(INSTALL_DIR) "$(DESTDIR)$(datadir)/applications" + @$(INSTALL_DATA) packaging/linux/openra.desktop "$(DESTDIR)$(datadir)/applications" + + @$(INSTALL_DIR) "$(DESTDIR)$(datadir)/applications" + @$(INSTALL_DATA) packaging/linux/openra-editor.desktop "$(DESTDIR)$(datadir)/applications" + uninstall: @-$(RM_R) "$(DATA_INSTALL_DIR)" @-$(RM_F) "$(BIN_INSTALL_DIR)/openra" @-$(RM_F) "$(BIN_INSTALL_DIR)/openra-editor" + @-$(RM_F) "$(DESTDIR)$(datadir)/applications/openra.desktop" + @-$(RM_F) "$(DESTDIR)$(datadir)/applications/openra-editor.desktop" + @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/16x16/apps/openra.png" + @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/32x32/apps/openra.png" + @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/32x32/apps/openra-editor.png" + @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/48x48/apps/openra.png" + @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/48x48/apps/openra-editor.png" + @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/64x64/apps/openra.png" + @-$(RM_F) "$(DESTDIR)$(datadir)/icons/hicolor/128x128/apps/openra.png" help: @echo to compile, run: @@ -353,12 +383,21 @@ help: @echo to compile with development tools, run: @echo \ \ make all @echo + @echo to check the official mods for erroneous yaml files, run: + @echo \ \ make test + @echo + @echo to generate documentation aimed at modders, run: + @echo \ \ make docs + @echo @echo to install, run: @echo \ \ make \[prefix=/foo\] \[bindir=/bar/bin\] install @echo @echo to install with development tools, run: @echo \ \ make \[prefix=/foo\] \[bindir=/bar/bin\] install-all @echo + @echo to install Linux desktop files and icons + @echo \ \ make install-shortcuts + @echo @echo to uninstall, run: @echo \ \ make uninstall @echo diff --git a/RALint/RALint.csproj b/OpenRA.Lint/OpenRA.Lint.csproj similarity index 96% rename from RALint/RALint.csproj rename to OpenRA.Lint/OpenRA.Lint.csproj index de6c32c3b8..cff0dbe68b 100644 --- a/RALint/RALint.csproj +++ b/OpenRA.Lint/OpenRA.Lint.csproj @@ -8,8 +8,8 @@ {F9FA4D9F-2302-470A-8A07-6E37F488C124} Exe Properties - RALint - RALint + OpenRA + OpenRA.Lint v3.5 512 @@ -36,7 +36,7 @@ true full false - ..\ + .. DEBUG;TRACE prompt 4 @@ -70,7 +70,7 @@ - + diff --git a/RALint/Settings.StyleCop b/OpenRA.Lint/Settings.StyleCop similarity index 100% rename from RALint/Settings.StyleCop rename to OpenRA.Lint/Settings.StyleCop diff --git a/RALint/RALint.cs b/OpenRA.Lint/YamlChecker.cs similarity index 92% rename from RALint/RALint.cs rename to OpenRA.Lint/YamlChecker.cs index ead78bede1..9416a990fa 100644 --- a/RALint/RALint.cs +++ b/OpenRA.Lint/YamlChecker.cs @@ -14,21 +14,21 @@ using OpenRA; using OpenRA.FileFormats; using OpenRA.Traits; -namespace RALint +namespace OpenRA.Lint { - static class RALint + static class YamlChecker { static int errors = 0; static void EmitError(string e) { - Console.WriteLine("RALint(1,1): Error: {0}", e); + Console.WriteLine("OpenRA.Lint(1,1): Error: {0}", e); ++errors; } static void EmitWarning(string e) { - Console.WriteLine("RALint(1,1): Warning: {0}", e); + Console.WriteLine("OpenRA.Lint(1,1): Warning: {0}", e); } static int Main(string[] args) diff --git a/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj b/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj index 8b636b7390..35ce9c3272 100644 --- a/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj +++ b/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj @@ -43,7 +43,6 @@ - AllRules.ruleset diff --git a/OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj b/OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj index 3f749abf5d..31d3e8665f 100644 --- a/OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj +++ b/OpenRA.Mods.D2k/OpenRA.Mods.D2k.csproj @@ -43,7 +43,6 @@ - DEBUG; diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index b19714e39f..804b7179f2 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -44,7 +44,6 @@ - AllRules.ruleset diff --git a/OpenRA.sln b/OpenRA.sln index 97e078699f..1f7cfd7087 100644 --- a/OpenRA.sln +++ b/OpenRA.sln @@ -21,7 +21,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Editor", "OpenRA.Edi EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.TilesetBuilder", "OpenRA.TilesetBuilder\OpenRA.TilesetBuilder.csproj", "{1A8E50CC-EE32-4E57-8842-0C39C8EA7541}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RALint", "RALint\RALint.csproj", "{F9FA4D9F-2302-470A-8A07-6E37F488C124}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Lint", "OpenRA.Lint\OpenRA.Lint.csproj", "{F9FA4D9F-2302-470A-8A07-6E37F488C124}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRA.Utility", "OpenRA.Utility\OpenRA.Utility.csproj", "{F33337BE-CB69-4B24-850F-07D23E408DDF}" EndProject diff --git a/packaging/linux/buildpackage.sh b/packaging/linux/buildpackage.sh index 4d6228b0cf..77354f4b55 100644 --- a/packaging/linux/buildpackage.sh +++ b/packaging/linux/buildpackage.sh @@ -15,22 +15,17 @@ ROOTDIR=root # Clean up rm -rf $ROOTDIR -# Game files -mkdir -p $ROOTDIR/usr/bin/ -cp -T openra-bin $ROOTDIR/usr/bin/openra -cp -T openra-editor-bin $ROOTDIR/usr/bin/openra-editor -mkdir -p $ROOTDIR/usr/share/openra/ -cp -R $BUILTDIR/* "$ROOTDIR/usr/share/openra/" || exit 3 +cd ../.. +# Copy files for OpenRA.Game.exe and OpenRA.Editor.exe as well as all dependencies. +make install-all prefix="/usr" DESTDIR="$PWD/packaging/linux/$ROOTDIR" # Launch scripts (executed by Desura) -cp ../../*.sh "$ROOTDIR/usr/share/openra/" || exit 3 +cp *.sh "$PWD/packaging/linux/$ROOTDIR/usr/share/openra/" || exit 3 -# Desktop Icons -mkdir -p $ROOTDIR/usr/share/applications/ -cp *.desktop "$ROOTDIR/usr/share/applications/" +# Icons and .desktop files +make install-shortcuts -mkdir -p $ROOTDIR/usr/share/icons/ -cp -r hicolor $ROOTDIR/usr/share/icons/ +cd packaging/linux ( echo "Building Debian package." diff --git a/packaging/linux/openra-bin b/packaging/linux/openra-bin deleted file mode 100755 index 0d4ba2622a..0000000000 --- a/packaging/linux/openra-bin +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -cd /usr/share/openra -mono OpenRA.Game.exe "$@" diff --git a/packaging/linux/openra-editor-bin b/packaging/linux/openra-editor-bin deleted file mode 100755 index cfc55f05f8..0000000000 --- a/packaging/linux/openra-editor-bin +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -cd /usr/share/openra -mono OpenRA.Editor.exe "$@"