Build script alterations, submodule update

This commit is contained in:
Luke 2016-12-10 21:54:43 +10:00
parent 272cc31b28
commit 703a31580e
6 changed files with 105 additions and 18 deletions

View file

@ -1,19 +1,27 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15 # Visual Studio 14
VisualStudioVersion = 15.0.25807.0 VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{755F5B05-0924-47E9-9563-26EB20FE3F67}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{755F5B05-0924-47E9-9563-26EB20FE3F67}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TShockAPI", "TShockAPI\TShockAPI.csproj", "{49606449-072B-4CF5-8088-AA49DA586694}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TShockAPI", "TShockAPI\TShockAPI.csproj", "{49606449-072B-4CF5-8088-AA49DA586694}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TerrariaServerAPI", "TerrariaServerAPI\TerrariaServerAPI\TerrariaServerAPI.csproj", "{6877506E-ADC6-4142-98A6-79E4FA02855A}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86 Debug|x86 = Debug|x86
Mono|Any CPU = Mono|Any CPU
Mono|Mixed Platforms = Mono|Mixed Platforms
Mono|x64 = Mono|x64
Mono|x86 = Mono|x86
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms Release|Mixed Platforms = Release|Mixed Platforms
Release|x64 = Release|x64
Release|x86 = Release|x86 Release|x86 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
@ -21,12 +29,45 @@ Global
{49606449-072B-4CF5-8088-AA49DA586694}.Debug|Any CPU.Build.0 = Debug|Any CPU {49606449-072B-4CF5-8088-AA49DA586694}.Debug|Any CPU.Build.0 = Debug|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {49606449-072B-4CF5-8088-AA49DA586694}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {49606449-072B-4CF5-8088-AA49DA586694}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Debug|x64.ActiveCfg = Debug|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Debug|x64.Build.0 = Debug|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Debug|x86.ActiveCfg = Debug|Any CPU {49606449-072B-4CF5-8088-AA49DA586694}.Debug|x86.ActiveCfg = Debug|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Mono|Any CPU.ActiveCfg = Release|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Mono|Any CPU.Build.0 = Release|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Mono|Mixed Platforms.ActiveCfg = Release|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Mono|Mixed Platforms.Build.0 = Release|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Mono|x64.ActiveCfg = Release|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Mono|x64.Build.0 = Release|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Mono|x86.ActiveCfg = Release|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Mono|x86.Build.0 = Release|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Release|Any CPU.ActiveCfg = Release|Any CPU {49606449-072B-4CF5-8088-AA49DA586694}.Release|Any CPU.ActiveCfg = Release|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Release|Any CPU.Build.0 = Release|Any CPU {49606449-072B-4CF5-8088-AA49DA586694}.Release|Any CPU.Build.0 = Release|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {49606449-072B-4CF5-8088-AA49DA586694}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Release|Mixed Platforms.Build.0 = Release|Any CPU {49606449-072B-4CF5-8088-AA49DA586694}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Release|x64.ActiveCfg = Release|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Release|x64.Build.0 = Release|Any CPU
{49606449-072B-4CF5-8088-AA49DA586694}.Release|x86.ActiveCfg = Release|Any CPU {49606449-072B-4CF5-8088-AA49DA586694}.Release|x86.ActiveCfg = Release|Any CPU
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Debug|Any CPU.ActiveCfg = Debug|x86
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Debug|Mixed Platforms.Build.0 = Debug|x86
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Debug|x64.ActiveCfg = Debug|x64
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Debug|x64.Build.0 = Debug|x64
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Debug|x86.ActiveCfg = Debug|x86
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Debug|x86.Build.0 = Debug|x86
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Mono|Any CPU.ActiveCfg = Mono|x86
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Mono|Mixed Platforms.ActiveCfg = Mono|x86
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Mono|Mixed Platforms.Build.0 = Mono|x86
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Mono|x64.ActiveCfg = Mono|x64
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Mono|x64.Build.0 = Mono|x64
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Mono|x86.ActiveCfg = Mono|x86
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Mono|x86.Build.0 = Mono|x86
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Release|Any CPU.ActiveCfg = Release|x86
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Release|Mixed Platforms.ActiveCfg = Release|x86
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Release|Mixed Platforms.Build.0 = Release|x86
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Release|x64.ActiveCfg = Release|x64
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Release|x64.Build.0 = Release|x64
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Release|x86.ActiveCfg = Release|x86
{6877506E-ADC6-4142-98A6-79E4FA02855A}.Release|x86.Build.0 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View file

@ -158,7 +158,6 @@ namespace TShockAPI.Sockets
{ {
try try
{ {
Console.WriteLine("Creating linux socket");
ISocket socket = new LinuxTcpSocket(this._listener.AcceptTcpClient()); ISocket socket = new LinuxTcpSocket(this._listener.AcceptTcpClient());
Console.WriteLine(Language.GetTextValue("Net.ClientConnecting", socket.GetRemoteAddress())); Console.WriteLine(Language.GetTextValue("Net.ClientConnecting", socket.GetRemoteAddress()));
this._listenerCallback(socket); this._listenerCallback(socket);

View file

@ -72,16 +72,13 @@
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="OTAPI"> <Reference Include="OTAPI, Version=1.3.4.4, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\prebuilts\OTAPI.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<HintPath>..\TerrariaServerAPI\TerrariaServerAPI\bin\Debug\OTAPI.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="TerrariaServer, Version=1.3.4.4, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\prebuilts\TerrariaServer.exe</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="BackupManager.cs" /> <Compile Include="BackupManager.cs" />
@ -185,6 +182,12 @@
<Install>true</Install> <Install>true</Install>
</BootstrapperPackage> </BootstrapperPackage>
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TerrariaServerAPI\TerrariaServerAPI\TerrariaServerAPI.csproj">
<Project>{6877506e-adc6-4142-98a6-79e4fa02855a}</Project>
<Name>TerrariaServerAPI</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PreBuildEvent> <PreBuildEvent>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<system.data> <system.data>
<DbProviderFactories> <DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" /> <remove invariant="MySql.Data.MySqlClient"/>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
</DbProviderFactories> </DbProviderFactories>
</system.data> </system.data>
</configuration> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>

@ -1 +1 @@
Subproject commit 9050642fb6a98d4f50d97db34f837aaf485d3bf7 Subproject commit 5144badb7e087ab1b8ba72c29b08b2e550873a1a

View file

@ -29,6 +29,7 @@ cur_wd = os.getcwd()
release_dir = os.path.join(cur_wd, "releases") release_dir = os.path.join(cur_wd, "releases")
terraria_bin_name = "TerrariaServer.exe" terraria_bin_name = "TerrariaServer.exe"
otapi_bin_name = "OTAPI.dll"
mysql_bin_name = "MySql.Data.dll" mysql_bin_name = "MySql.Data.dll"
sqlite_dep_name = "sqlite3.dll" sqlite_dep_name = "sqlite3.dll"
sqlite_bin_name = "Mono.Data.Sqlite.dll" sqlite_bin_name = "Mono.Data.Sqlite.dll"
@ -39,13 +40,14 @@ tshock_symbols = "TShockAPI.dll.mdb"
bcrypt_bin_name = "BCrypt.Net.dll" bcrypt_bin_name = "BCrypt.Net.dll"
geoip_db_name = "GeoIP.dat" geoip_db_name = "GeoIP.dat"
terraria_release_bin = os.path.join(cur_wd, "TerrariaServerAPI", "bin", "Release", terraria_bin_name) terraria_release_bin = os.path.join(cur_wd, "TerrariaServerAPI", "TerrariaServerAPI", "bin", "Release", terraria_bin_name)
terraria_debug_bin = os.path.join(cur_wd, "TerrariaServerAPI", "bin", "Debug", terraria_bin_name) terraria_debug_bin = os.path.join(cur_wd, "TerrariaServerAPI", "TerrariaServerAPI", "bin", "Debug", terraria_bin_name)
otapi_bin = os.path.join(cur_wd, "TerrariaServerAPI", "TerrariaServerAPI", "bin", "Release", otapi_bin_name)
mysql_bin = os.path.join(cur_wd, "packages", "MySql.Data.6.9.8", "lib", "net45", mysql_bin_name) mysql_bin = os.path.join(cur_wd, "packages", "MySql.Data.6.9.8", "lib", "net45", mysql_bin_name)
sqlite_dep = os.path.join(cur_wd, "prebuilts", sqlite_dep_name) sqlite_dep = os.path.join(cur_wd, "prebuilts", sqlite_dep_name)
sqlite_bin = os.path.join(cur_wd, "prebuilts", sqlite_bin_name) sqlite_bin = os.path.join(cur_wd, "prebuilts", sqlite_bin_name)
http_bin = os.path.join(cur_wd, "prebuilts", http_bin_name) http_bin = os.path.join(cur_wd, "prebuilts", http_bin_name)
json_bin = os.path.join(cur_wd, "packages", "Newtonsoft.Json.8.0.3", "lib", "net45", json_bin_name) json_bin = os.path.join(cur_wd, "packages", "Newtonsoft.Json.9.0.1", "lib", "net45", json_bin_name)
bcrypt_bin = os.path.join(cur_wd, "packages", "BCrypt.Net.0.1.0", "lib", "net35", bcrypt_bin_name) bcrypt_bin = os.path.join(cur_wd, "packages", "BCrypt.Net.0.1.0", "lib", "net35", bcrypt_bin_name)
geoip_db = os.path.join(cur_wd, "prebuilts", geoip_db_name) geoip_db = os.path.join(cur_wd, "prebuilts", geoip_db_name)
release_bin = os.path.join(cur_wd, "TShockAPI", "bin", "Release", tshock_bin_name) release_bin = os.path.join(cur_wd, "TShockAPI", "bin", "Release", tshock_bin_name)
@ -66,18 +68,20 @@ def copy_dependencies():
def copy_debug_files(): def copy_debug_files():
shutil.copy(terraria_debug_bin, release_dir) shutil.copy(terraria_debug_bin, release_dir)
shutil.copy(otapi_bin, release_dir)
shutil.copy(os.path.join(debug_folder, tshock_bin_name), release_dir) shutil.copy(os.path.join(debug_folder, tshock_bin_name), release_dir)
shutil.copy(os.path.join(debug_folder, tshock_symbols), release_dir) shutil.copy(os.path.join(debug_folder, tshock_symbols), release_dir)
def copy_release_files(): def copy_release_files():
shutil.copy(terraria_release_bin, release_dir) shutil.copy(terraria_release_bin, release_dir)
shutil.copy(release_bin, release_dir) shutil.copy(otapi_bin, release_dir)
shutil.copy(release_bin, release_dir) shutil.copy(release_bin, release_dir)
def create_base_zip(name): def create_base_zip(name):
os.chdir(release_dir) os.chdir(release_dir)
zip = zipfile.ZipFile(name, "w") zip = zipfile.ZipFile(name, "w")
zip.write(terraria_bin_name) zip.write(terraria_bin_name)
zip.write(otapi_bin_name)
zip.write(sqlite_dep_name) zip.write(sqlite_dep_name)
zip.write(geoip_db_name) zip.write(geoip_db_name)
zip.write(http_bin_name, os.path.join("ServerPlugins", http_bin_name)) zip.write(http_bin_name, os.path.join("ServerPlugins", http_bin_name))
@ -136,6 +140,44 @@ def upload_artifacts():
def update_terraria_source(): def update_terraria_source():
subprocess.check_call(['/usr/bin/git', 'submodule', 'init']) subprocess.check_call(['/usr/bin/git', 'submodule', 'init'])
subprocess.check_call(['/usr/bin/git', 'submodule', 'update']) subprocess.check_call(['/usr/bin/git', 'submodule', 'update'])
subprocess.check_call(['nuget', 'restore', 'TerrariaServerAPI/'])
def run_bootstrapper():
for build_config in ['Debug','Release'] :
mod_bootstrapper_proc = subprocess.Popen(['xbuild', './TerrariaServerAPI/TShock.Modifications.Bootstrapper/TShock.Modifications.Bootstrapper.csproj', '/p:Configuration=' + build_config])
mod_clientuuid_proc = subprocess.Popen(['xbuild', './TerrariaServerAPI/TShock.Modifications.ClientUUID/TShock.Modifications.ClientUUID.csproj', '/p:Configuration=' + build_config])
mod_explosives_proc = subprocess.Popen(['xbuild', './TerrariaServerAPI/TShock.Modifications.Explosives/TShock.Modifications.Explosives.csproj', '/p:Configuration=' + build_config])
mod_ssc_proc = subprocess.Popen(['xbuild', './TerrariaServerAPI/TShock.Modifications.SSC/TShock.Modifications.SSC.csproj', '/p:Configuration=' + build_config])
mod_bootstrapper_proc.wait()
mod_clientuuid_proc.wait()
mod_explosives_proc.wait()
mod_ssc_proc.wait()
if (mod_bootstrapper_proc.returncode != 0):
raise CalledProcessError(mod_bootstrapper_proc.returncode)
if (mod_clientuuid_proc.returncode != 0):
raise CalledProcessError(mod_clientuuid_proc.returncode)
if (mod_explosives_proc.returncode != 0):
raise CalledProcessError(mod_explosives_proc.returncode)
if (mod_ssc_proc.returncode != 0):
raise CalledProcessError(mod_ssc_proc.returncode)
# run the bootstrapper to generate the new OTAPI.dll
os.chdir('./TerrariaServerAPI/TShock.Modifications.Bootstrapper/bin/' + build_config)
bootstrapper_proc = subprocess.Popen(['mono', 'TShock.Modifications.Bootstrapper.exe', '-in=OTAPI.dll', '-mod=../../../TShock.Modifications.**/bin/' + build_config + '/TShock.Modifications.*.dll', '-o=Output/OTAPI.dll'])
os.chdir(cur_wd)
bootstrapper_proc.wait()
if (bootstrapper_proc.returncode != 0):
raise CalledProcessError(bootstrapper_proc.returncode)
tsapi_proc = subprocess.Popen(['xbuild', './TerrariaServerAPI/TerrariaServerAPI/TerrariaServerAPI.csproj', '/p:Configuration=' + build_config])
tsapi_proc.wait()
if (tsapi_proc.returncode != 0):
raise CalledProcessError(tsapi_proc.returncode)
def build_software(): def build_software():
release_proc = subprocess.Popen(['xbuild', './TShockAPI/TShockAPI.csproj', '/p:Configuration=Release']) release_proc = subprocess.Popen(['xbuild', './TShockAPI/TShockAPI.csproj', '/p:Configuration=Release'])
@ -146,10 +188,12 @@ def build_software():
raise CalledProcessError(release_proc.returncode) raise CalledProcessError(release_proc.returncode)
if (debug_proc.returncode != 0): if (debug_proc.returncode != 0):
raise CalledProcessError(debug_proc.returncode) raise CalledProcessError(debug_proc.returncode)
if __name__ == '__main__': if __name__ == '__main__':
create_release_folder() create_release_folder()
update_terraria_source() update_terraria_source()
run_bootstrapper();
copy_dependencies() copy_dependencies()
build_software() build_software()
package_release() package_release()