Source code for UMake.exe

Discussions about Coding and Scripting
User avatar
Dizzy
Experienced
Posts: 109
Joined: Tue May 21, 2013 3:57 pm
Personal rank: Oaf

Source code for UMake.exe

Post by Dizzy » Sun Oct 01, 2017 7:14 pm

Does anyone know if the source code for UMake was ever released or if the author is still active?
Join the BunnyTrack.net Discord chat server: https://www.bunnytrack.net/discord

nogardilaref
Masterful
Posts: 579
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Source code for UMake.exe

Post by nogardilaref » Mon Oct 02, 2017 12:04 am

I am not sure if there is, but UMake is nothing more than a program to manage things up in order to make the compilation of new packages easier.

All it does is to automate certain tasks which until then you would have to do by hand or by a bash script, so in the end it still calls UCC itself the same way you would if you used it directly (if that's the sort of thing you're looking for).
In other words, probably any dev is able to come up with a "UMake" of their own in a single afternoon, so I am not sure if its source is something worth pursuing, depending on what you intend to find there.

JackGriffin
Godlike
Posts: 3766
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Source code for UMake.exe

Post by JackGriffin » Mon Oct 02, 2017 3:21 am

I'd be stoked to get at it too. I use UMake and there's a couple of things I'd like to change just for myself.
So long, and thanks for all the fish

User avatar
Dizzy
Experienced
Posts: 109
Joined: Tue May 21, 2013 3:57 pm
Personal rank: Oaf

Re: Source code for UMake.exe

Post by Dizzy » Mon Oct 02, 2017 4:54 pm

All I want to do is add a silent flag which would suppress most dialog boxes so it can be used in command line scripts.
Join the BunnyTrack.net Discord chat server: https://www.bunnytrack.net/discord

nogardilaref
Masterful
Posts: 579
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Source code for UMake.exe

Post by nogardilaref » Tue Oct 03, 2017 7:54 pm

Dizzy wrote:All I want to do is add a silent flag which would suppress most dialog boxes so it can be used in command line scripts.
In other words, what you want is UCC.exe itself. :mrgreen:

Before UMake was a thing, developers would use a script of their own to do the exact same thing as UMake, but without dialogs as you want. After all, UMake is entirely about the very dialogs you want to deactivate.
All you have to do in such a script is to rename, move or delete any previous compiled package, maybe copy your source directory into the UT root directory, and then call UCC.exe itself, perhaps with an argument to point towards your own package .ini file so you can isolate your dependencies properly through EditPackages, without messing with the UT ini files themselves.

I think that creating such a small simple script will save you a lot more time than trying to find UMake source and modify it so it hides its dialogs.

User avatar
Chamberly
Godlike
Posts: 1962
Joined: Sat Sep 17, 2011 4:32 pm
Personal rank: Dame. Vandora
Location: TN, USA

Re: Source code for UMake.exe

Post by Chamberly » Tue Oct 03, 2017 8:53 pm

Have you checked out UCC2? viewtopic.php?f=15&t=6601
Image
Image
Image Edit: Why does my sig not work anymore?

User avatar
Barbie
Godlike
Posts: 2069
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Source code for UMake.exe

Post by Barbie » Tue Oct 03, 2017 8:55 pm

nogardilaref wrote:All you have to do in such a script is to rename, move or delete any previous compiled package, maybe copy your source directory into the UT root directory, and then call UCC.exe itself, perhaps with an argument to point towards your own package .ini file so you can isolate your dependencies properly through EditPackages
Exact. :agree1:
My repository is on a network drive (H:) and the UT installation on a local drive (D:). My script mirrors the source files into the UT directory, removes previous U file(s) and calls ucc.exe with the project specific make file.
All I have to do is calling MAKE.CMD in the source directory after I have changed the source (and manually go to line/column in editor, if an error occurs).
Example of MAKE.CMD
Show

Code: Select all

@echo off
  rem root directory for projects:
set PROJECT_ROOT=H:\Games\UT\dev
set PROJECT_NAME=SBTrophyDude
set PROJECT_VERSION=V1
set UTDIR=D:\Programme\UT
set UT_PROJECT_NAME=SBTrophyDude
set PROJECT_REDIR=

  rem Move/copy the compiled version to PROJECT_SYSTEM? Set to "copy", "move" or anything else, if not action should be done. Implies compressing/moving to PROJECT_REDIR.
set COMPILED2PROJECT_SYSTEM=copy

  rem ------ no need to change below stuff usually -------
set PROJECT_DIR=%PROJECT_ROOT%\%PROJECT_NAME%\%PROJECT_VERSION%
set PROJECT_SRCCODE=%PROJECT_DIR%\Sourcecode
set PROJECT_SRCCODE_MAKEFILE=%PROJECT_SRCCODE%\make.ini
set PROJECT_SYSTEM=%PROJECT_DIR%\System
set PROJECT_FULLNAME=%PROJECT_NAME%%PROJECT_VERSION%
set UT_PROJECT_FULLNAME=%UT_PROJECT_NAME%%PROJECT_VERSION%

title %PROJECT_FULLNAME%

	rem sanity checks:

if not exist %PROJECT_DIR%\NUL (
	set ERRORMSG=PROJECT_DIR-directory is missing: "%PROJECT_DIR%"
	goto Error
)

if not exist %PROJECT_SRCCODE%\NUL (
	set ERRORMSG=PROJECT_SRCCODE-directory is missing: "%PROJECT_SRCCODE%"
	goto Error
)

if not exist %PROJECT_SRCCODE%\make.ini (
	set ERRORMSG=make.ini is missing in directory "%PROJECT_SRCCODE%"
	goto Error
)
	
find /I "EditPackages=%PROJECT_FULLNAME%" %PROJECT_SRCCODE%\make.ini > nul
if errorlevel=1 (
	set ERRORMSG=the line "EditPackages=%PROJECT_FULLNAME%" is missing in %PROJECT_SRCCODE%\make.ini
	goto Error
)

if NOT "%PROJECT_REDIR%"=="" (
	if not exist %PROJECT_REDIR%\NUL (
		set ERRORMSG=PROJECT_REDIR-directory is missing: "%PROJECT_REDIR%"
		goto Error
	)
)

if not exist %PROJECT_SYSTEM%\NUL (
	set ERRORMSG=PROJECT_SYSTEM-directory is missing: "%PROJECT_SYSTEM%"
	goto Error
)

if not exist %PROJECT_SRCCODE_MAKEFILE% (
	set ERRORMSG=PROJECT_SRCCODE_MAKEFILE is missing: "%PROJECT_SRCCODE_MAKEFILE%"
	goto Error
)

	rem delete previous .U-file, if exist:
if exist "%UTDIR%\System\%UT_PROJECT_FULLNAME%.u" del "%UTDIR%\System\%UT_PROJECT_FULLNAME%.u"
if exist "%UTDIR%\System\%UT_PROJECT_FULLNAME%.u"  (
	set ERRORMSG=could not remove old file: %UTDIR%\System\%UT_PROJECT_FULLNAME%.u
	goto Error
)

if not exist %UTDIR%\%UT_PROJECT_FULLNAME%\NUL mkdir %UTDIR%\%UT_PROJECT_FULLNAME%

robocopy %PROJECT_SRCCODE% %UTDIR%\%UT_PROJECT_FULLNAME% /MIR /njh /njs /ndl
echo .> "%UTDIR%\%UT_PROJECT_FULLNAME%\Do not edit these mirrored files"

	rem cd %PROJECT_SRCCODE%
%UTDIR%\System\ucc.exe make ini=%PROJECT_SRCCODE_MAKEFILE%
if %errorlevel%==1 (
	set ERRORMSG=An UCC error occured
	goto Error
)

if NOT exist "%UTDIR%\System\%UT_PROJECT_FULLNAME%.u" (
	set ERRORMSG=the file "%UTDIR%\System\%UT_PROJECT_FULLNAME%.u" does not exist!
	goto Error
)


if "%COMPILED2PROJECT_SYSTEM%"=="copy" (
	set CMD=copy
	GoTo DoMoveOrCopy
)
if "%COMPILED2PROJECT_SYSTEM%"=="move" (
	set CMD=move
	GoTo DoMoveOrCopy
)
goto end


:DoMoveOrCopy
%CMD% %UTDIR%\System\%UT_PROJECT_FULLNAME%.u %PROJECT_SYSTEM%\

if NOT "%PROJECT_REDIR%"=="" (
	if exist %PROJECT_REDIR%\%UT_PROJECT_FULLNAME%.u.uz del %PROJECT_REDIR%\%UT_PROJECT_FULLNAME%.u.uz
	%UTDIR%\System\ucc.exe compress %PROJECT_SYSTEM%\%UT_PROJECT_FULLNAME%.u
	move %PROJECT_SYSTEM%\%UT_PROJECT_FULLNAME%.u.uz %PROJECT_REDIR%\
)

goto end


:Error
echo Error: %ERRORMSG%
goto end

:end
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett

User avatar
Dizzy
Experienced
Posts: 109
Joined: Tue May 21, 2013 3:57 pm
Personal rank: Oaf

Re: Source code for UMake.exe

Post by Dizzy » Wed Oct 04, 2017 8:26 pm

UMake has useful features like displaying compilation errors, opening your IDE at the error line, etc. so I'd rather not re-invent the wheel.

Specifically my script will:

1. Compile latest project
2. Upload compiled file to FTP server
3. Restart remote UT server
4. Start local UT client for testing
Join the BunnyTrack.net Discord chat server: https://www.bunnytrack.net/discord

Buggie
Adept
Posts: 420
Joined: Sat Mar 21, 2020 5:32 am

Re: Source code for UMake.exe

Post by Buggie » Fri Jul 24, 2020 9:17 pm

Hm. I too interested in source code. I willing add button "recompile" if compile fail, because in another window I already edit script. But this not supported and I need drop this folder to Umake again and again.