tools.icl 2.59 KB
Newer Older
Diederik van Arkel's avatar
Diederik van Arkel committed
1
2
3
4
5
6
7
8
9
10
11
implementation module tools

import StdBool, StdFunc, StdFile, StdPStClass, StdSystem
import ExtNotice, StdPathname
import IdeState, UtilIO

//-- call out to supporting applications...
//-- should make these settable in the ide...
//-- ahhh... problem is then how to inform the change_registry
//-- application of their new location...

Diederik van Arkel's avatar
Diederik van Arkel committed
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
timepsuf	=: " Time Profile.pcl"
timepdir	=: applicationpath "Tools\\TimeProfiler"
timepapp	=: quoted_string (MakeFullPathname timepdir "ShowTimeProfile.exe")
timeparg	=: " -h 4M "

heappsuf	=: " Heap Profile0.hcl"
heappdir	=: applicationpath "Tools\\HeapProfiler"
heappapp	=: quoted_string (MakeFullPathname heappdir "ShowHeapProfile.exe")
heapparg	=: " -h 4M "

proofsuf	=: ".prj"
proofdir	=: applicationpath "Tools\\Sparkle"
proofapp	=: quoted_string (MakeFullPathname proofdir "Sparkle.exe")
proofarg	=: " "

shoprofun :: !*(PSt General) -> *PSt General
Diederik van Arkel's avatar
Diederik van Arkel committed
28
29
30
31
32
33
shoprofun ps
	# (prj,ps)		= getProject ps
	# execpath		= PR_GetExecPath prj
	// approximate name mangling done by RTE
	//--> expand pathname...
	// should still take into account max filename length
Diederik van Arkel's avatar
Diederik van Arkel committed
34
35
	# profpath		= quoted_string (RemoveSuffix` execpath +++ timepsuf)
	# sp			= timepapp +++ timeparg +++ profpath
Diederik van Arkel's avatar
Diederik van Arkel committed
36
37
	# stup			= RemoveFilename execpath
	# (ok,ps)		= accFiles (FExists stup) ps
Diederik van Arkel's avatar
Diederik van Arkel committed
38
	# stup			= if ok (stup +++ "\\") (applicationpath "")
Diederik van Arkel's avatar
Diederik van Arkel committed
39
40
	# (ok,ps)		= accFiles (LaunchApplication sp stup False) ps
	| not ok
Diederik van Arkel's avatar
Diederik van Arkel committed
41
		= openNotice (Notice ["Unable to launch " +++  sp +++ ".",stup] (NoticeButton "OK" id) []) ps
Diederik van Arkel's avatar
Diederik van Arkel committed
42
43
	= ps

Diederik van Arkel's avatar
Diederik van Arkel committed
44
shoheapfun :: !*(PSt General) -> *PSt General
Diederik van Arkel's avatar
Diederik van Arkel committed
45
46
47
48
49
shoheapfun ps
	# (prj,ps)		= getProject ps
	# execpath		= PR_GetExecPath prj
	// approximate name mangling done by RTE
	// should still take into account max filename length
Diederik van Arkel's avatar
Diederik van Arkel committed
50
51
	# profpath		= quoted_string (RemoveSuffix` execpath +++ heappsuf)
	# sp			= heappapp +++  heapparg +++  profpath
Diederik van Arkel's avatar
Diederik van Arkel committed
52
53
	# stup			= RemoveFilename execpath
	# (ok,ps)		= accFiles (FExists stup) ps
Diederik van Arkel's avatar
Diederik van Arkel committed
54
	# stup			= if ok (stup +++ "\\") (applicationpath "")
Diederik van Arkel's avatar
Diederik van Arkel committed
55
56
	# (ok,ps)		= accFiles (LaunchApplication sp stup False) ps
	| not ok
Diederik van Arkel's avatar
Diederik van Arkel committed
57
		= openNotice (Notice ["Unable to launch " +++  sp +++ ".",stup] (NoticeButton "OK" id) []) ps
Diederik van Arkel's avatar
Diederik van Arkel committed
58
59
	= ps

Diederik van Arkel's avatar
Diederik van Arkel committed
60
provefun :: !*(PSt General) -> *PSt General
Diederik van Arkel's avatar
Diederik van Arkel committed
61
62
provefun ps
	# (pathname,ps) = getPath ps
Diederik van Arkel's avatar
Diederik van Arkel committed
63
64
	# pr_path		= quoted_string (RemoveSuffix` pathname +++. proofsuf)
	# cps			= proofapp +++ proofarg +++ pr_path
Diederik van Arkel's avatar
Diederik van Arkel committed
65
66
	# stup			= RemoveFilename pathname
	# (ok,ps)		= accFiles (FExists stup) ps
Diederik van Arkel's avatar
Diederik van Arkel committed
67
	# stup			= if ok (stup +++ "\\") (applicationpath "")
Diederik van Arkel's avatar
Diederik van Arkel committed
68
69
	# (ok,ps)		= accFiles (LaunchApplication cps stup False) ps
	| not ok
Diederik van Arkel's avatar
Diederik van Arkel committed
70
		= openNotice (Notice ["Unable to launch " +++  cps +++ "."] (NoticeButton "OK" id) []) ps
Diederik van Arkel's avatar
Diederik van Arkel committed
71
72
	= ps