MakeInstall4

git-svn-id: svn://ultimatepp.org/upp/trunk@971 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-03-17 20:44:19 +00:00
parent cbe5a30e3a
commit 8085dfdde4
5 changed files with 118 additions and 114 deletions

View file

@ -1,112 +1,112 @@
#include <Core/Core.h>
#include <plugin/bz2/bz2.h>
using namespace Upp;
void Log(const char *txt)
{
Cout() << txt << "\r\n";
}
void Error(const char *e)
{
Log(e);
abort();
}
String Syx(const char *s)
{
Log(s);
String r = Sys(s);
if(r.IsVoid())
Error("Failed: " + String(s));
return r;
}
void CopyFolder(const char *src, const char *dst, bool deep = true)
{
Cout() << Sprintf("Directory %s\n", src);
RealizeDirectory(dst);
FindFile ff(String(src) + "/*.*");
while(ff) {
String s = AppendFileName(src, ff.GetName());
String d = AppendFileName(dst, ff.GetName());
if(ff.IsFile()) {
String q = LoadFile(s);
String ext = ToLower(GetFileExt(s));
if(ext != ".aux" && ext != ".$old")
SaveFile(d, q);
}
else
if(ff.IsFolder() && *ff.GetName() != '.') {
if(deep || *GetFileExt(s))
CopyFolder(s, d, deep);
}
ff.Next();
}
}
int CrLfSm(int c)
{
return c == ';' || c == '\r' || c == '\n';
}
void CopyFolders(const char *src, const char *dst, const char *folders, bool deep = true)
{
Vector<String> folder = Split(LoadFile(folders), CrLfSm);
for(int i = 0; i < folder.GetCount(); i++)
CopyFolder(AppendFileName(src, folder[i]), AppendFileName(dst, folder[i]), deep);
}
String tmp = "u:/upp.tmp";
String upptmp = tmp + "/u";
String upp = "u:/upp.src";
String uppsrc = upp + "/uppsrc";
String win32 = "u:/theide";
void CopyIdeFile(const String& fn)
{
SaveFile(upptmp + '/' + fn, LoadFile(win32 + '/' + fn));
}
int NoDigit(int c) { return IsDigit(c) ? 0 : c; }
int FilterVersion(int c) { return c == ':' ? '_' : c; }
CONSOLE_APP_MAIN
{
if(FileExists("u:/theide/theide.exe"))
win32 = "u:/theide";
else
win32 = "u:/Win32/theide";
Vector<String> s = Split(Syx("svnversion " + upp), NoDigit);
if(s.GetCount() == 0)
Error("Invalid version");
String version = s.Top();
Log("version: " + version);
DeleteFolderDeep(tmp);
RealizeDirectory(tmp);
CopyFolders(uppsrc, upptmp + "/uppsrc", uppsrc + "/packages");
CopyFolders(uppsrc, upptmp + "/uppsrc", uppsrc + "/packages1", false);
CopyFolders(upp, upptmp, uppsrc + "/assemblies");
SaveFile(upptmp + "/uppsrc/ide/version.h", "#define IDE_VERSION \"" + version + "\"");
Syx(win32 + "/umk upptmp ide MSC9 -ar " + upptmp + "/theide.exe");
Syx(win32 + "/umk upptmp umk MSC9 -ar " + upptmp + "/umk.exe");
CopyIdeFile("dbghelp.dll");
CopyIdeFile("en-us.scd");
CopyIdeFile("en-gb.scd");
SetCurrentDirectory(upptmp);
SaveFile("install.upp", LoadFile(uppsrc + "/install.upp"));
SaveFile("license.chk", "1");
Syx(win32 + "/7za/7za.exe a " + tmp + "/upp.7z * -r -mx -m0fb=255 -mf=off");
SetCurrentDirectory(tmp);
Syx(win32 + "/umk uppbox WinInstaller2 MSC9 -ar u:/upp-win32-" + Filter(version, FilterVersion) + ".exe");
}
~/googlecode_upload.py -s win32_daily_build -p upp-mirror upp-win32-962.exe
#include <Core/Core.h>
#include <plugin/bz2/bz2.h>
using namespace Upp;
void Log(const char *txt)
{
Cout() << txt << "\r\n";
}
void Error(const char *e)
{
Log(e);
abort();
}
String Syx(const char *s)
{
Log(s);
String r = Sys(s);
if(r.IsVoid())
Error("Failed: " + String(s));
return r;
}
void CopyFolder(const char *src, const char *dst, bool deep = true)
{
Cout() << Sprintf("Directory %s\n", src);
RealizeDirectory(dst);
FindFile ff(String(src) + "/*.*");
while(ff) {
String s = AppendFileName(src, ff.GetName());
String d = AppendFileName(dst, ff.GetName());
if(ff.IsFile()) {
String q = LoadFile(s);
String ext = ToLower(GetFileExt(s));
if(ext != ".aux" && ext != ".$old")
SaveFile(d, q);
}
else
if(ff.IsFolder() && *ff.GetName() != '.') {
if(deep || *GetFileExt(s))
CopyFolder(s, d, deep);
}
ff.Next();
}
}
int CrLfSm(int c)
{
return c == ';' || c == '\r' || c == '\n';
}
void CopyFolders(const char *src, const char *dst, const char *folders, bool deep = true)
{
Vector<String> folder = Split(LoadFile(folders), CrLfSm);
for(int i = 0; i < folder.GetCount(); i++)
CopyFolder(AppendFileName(src, folder[i]), AppendFileName(dst, folder[i]), deep);
}
String tmp = "u:/upp.tmp";
String upptmp = tmp + "/u";
String upp = "u:/upp.src";
String uppsrc = upp + "/uppsrc";
String win32 = "u:/theide";
void CopyIdeFile(const String& fn)
{
SaveFile(upptmp + '/' + fn, LoadFile(win32 + '/' + fn));
}
int NoDigit(int c) { return IsDigit(c) ? 0 : c; }
int FilterVersion(int c) { return c == ':' ? '_' : c; }
CONSOLE_APP_MAIN
{
if(FileExists("u:/theide/theide.exe"))
win32 = "u:/theide";
else
win32 = "u:/Win32/theide";
Vector<String> s = Split(Syx("svnversion " + upp), NoDigit);
if(s.GetCount() == 0)
Error("Invalid version");
String version = s.Top();
Log("version: " + version);
DeleteFolderDeep(tmp);
RealizeDirectory(tmp);
CopyFolders(uppsrc, upptmp + "/uppsrc", uppsrc + "/packages");
CopyFolders(uppsrc, upptmp + "/uppsrc", uppsrc + "/packages1", false);
CopyFolders(upp, upptmp, uppsrc + "/assemblies");
SaveFile(upptmp + "/uppsrc/ide/version.h", "#define IDE_VERSION \"" + version + "\"");
Syx(win32 + "/umk upptmp ide MSC9 -ar " + upptmp + "/theide.exe");
Syx(win32 + "/umk upptmp umk MSC9 -ar " + upptmp + "/umk.exe");
CopyIdeFile("dbghelp.dll");
CopyIdeFile("en-us.scd");
CopyIdeFile("en-gb.scd");
SetCurrentDirectory(upptmp);
SaveFile("install.upp", LoadFile(uppsrc + "/install.upp"));
SaveFile("license.chk", "1");
Syx(win32 + "/7za/7za.exe a " + tmp + "/upp.7z * -r -mx -m0fb=255 -mf=off");
SetCurrentDirectory(tmp);
Syx(win32 + "/umk uppbox WinInstaller2 MSC9 -ar u:/upload/upp-win32-" + Filter(version, FilterVersion) + ".exe");
}
// ~/googlecode_upload.py -s win32_daily_build -p upp-mirror upp-win32-962.exe

View file

@ -3,6 +3,8 @@ echo Path: $PATH
echo Home: $HOME
export WINEDEBUG=-all wine program.exe
mkdir ~/upload || true
bash ~/upp.src/uppbox/Scripts/www
bash ~/upp.src/uppbox/Scripts/win

View file

@ -1 +1 @@
bin/theide uppsrc ide GCC -asrxM upp.src
bin/theide uppsrc ide GCC -asrxM upp.src

View file

@ -1,2 +1,4 @@
rm ~/upload/* || true
wine "u:\Win32\theide\umk" uppbox MakeInstall4 MSC9 -ar "u:\mku.exe"
wine "u:\mku.exe"
upload

View file

@ -1,3 +1,3 @@
rm ~/tmp/makeweb
rm ~/tmp/makeweb || true
~/bin/theide uppbox uppweb GCC -abrs ~/tmp/makeweb
~/tmp/makeweb