forked from VFPX/GoFish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuildGoFish.PRG
114 lines (86 loc) · 4.25 KB
/
BuildGoFish.PRG
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
If Version(4) != "09.00.0000.7423" Then
Messagebox("Run with VFP9 SP2!")
Return .F.
Endif &&Version(4)!= "09.00.0000.7423"
CLEAR ALL
Local lcApplicationName, lcBetaFolder, lcBootStrap, lcBuild, lcBuildDate, lcBuildGoFishHeaderFile
Local lcCloudVersionFileContents, lcDate, lcDownloadUrl, lcErrorFile, lcGoFishHomePage, lcHgData
Local lcIncludeFileText, lcMercurialVersionFile, lcMonthDay, lcProject, lcSourceLoc, lcVersion
Local lcVersionFileContents, lcVersionFileURL, lcVersionLocalFile, lcVersionStringForVersionFile
Local lcAppFile, lcWindowTitle, lcYear, llBuildAsBeta, lnCurrentVersion, lcSafety, lcCloudVersionFile
lcSafety = Set('Safety')
Set Safety Off
lcSourceLoc = Addbs(Justpath(Sys(16))) && Change this to location of source files
Cd (lcSourceLoc)
*== Most of these local variables will make their way into BuildGoFish.h
lcVersion = '6.2' && This level is to be used to control structure changes in the storage
* && see NewVersion OF GoFishProc.prg
lcBuild = '005' && <---- Set your desired version level of the tool here
&& This will be used on the GoFish form and will live on the
&& the _GoFish object that gets attached to _Screen at run time.
lcApplicationName = 'GoFish'
lcVersionLocalFile = 'GoFishVersionFile.txt'
lcVersionFileURL = 'https://github.com/VFPX/GoFish/_GoFishVersionFile.txt'
lcDownloadUrl = 'https://raw.githubusercontent.com/VFPX/GoFish/master/Source/Source.zip'
lcGoFishHomePage = 'https://github.com/VFPX/GoFish'
* This will appear as: '5.X.YYY' on the form, and in the cVersion property on the GoFishSeaerch Engine class
lcWindowTitle = 'Building ' + lcApplicationName
? 'Building ' + lcApplicationName + ' Ver ' + lcVersion + ' Build ' + lcBuild
?? " (" + lcVersion + '.' + lcBuild + ")..."
? ' '
*------------------------------------------------------------------------------------
*=================================================================================================
lcVersion = lcVersion + '.' + lcBuild
*-- Create a file in the source file which contains the Version number
lcDate = Transform(Date(), '@YL')
lcMonthDay = Alltrim(Getwordnum(lcDate, 2, ','))
lcYear = Alltrim(Getwordnum(lcDate, 3, ','))
lcBuildDate = lcMonthDay + ', ' + lcYear
lcVersionStringForVersionFile = lcApplicationName + ' - ' + lcVersion + ' - ' + lcBuildDate + ' - ' + Dtoc (Date(), 1)
TEXT to lcIncludeFileText NoShow TextMerge
#DEFINE GOFISH_APP_NAME '<<lcApplicationName>>'
#DEFINE GOFISH_APP_FILE '<<lcApplicationName + ".app">>'
#DEFINE GOFISH_VERSION '<<lcVersion>>'
#DEFINE GOFISH_BUILDDATE '<<lcBuildDate>>'
#DEFINE GOFISH_DBUILDDATE Date(<<Year(Date())>>,<<Month(Date())>>, <<Day(Date())>>)
#DEFINE GOFISH_DOWNLOAD_URL '<<lcDownloadUrl>>'
#DEFINE GOFISH_VERSION_STRING_FOR_VERSION_FILE '<<lcVersionStringForVersionFile>>'
#DEFINE THOR_TOOL_NAME '<<"Thor_Tool_" + lcApplicationName>>'
#DEFINE VERSON_FILE_URL '<<lcVersionFileURL>>'
#DEFINE VERSION_LOCAL_FILE '<<lcVersionLocalFile>>'
#DEFINE GOFISH_HOME_PAGE '<<lcGoFishHomePage>>'
ENDTEXT
*=== Create the local version File ======================================================
lcVersionFileContents = lcApplicationName + Chr(13) + Chr(10) + ;
lcVersionStringForVersionFile + Chr(13) + Chr(10) + ;
lcDownloadUrl
*=== Create the Cloud version file ===========================================
*-- Write out the Include file with the current version and build date as contants
lcBuildGoFishHeaderFile = 'BuildGoFish.h'
Delete File (lcBuildGoFishHeaderFile)
? "Writing include file: " + lcBuildGoFishHeaderFile
Strtofile(lcIncludeFileText, lcBuildGoFishHeaderFile)
lcBootStrap = 'GoFish.prg'
Compile (lcBootStrap)
lcProject = lcSourceLoc + 'GoFish.Pjx'
If File(lcProject)
Build App (lcApplicationName) From (lcProject)
?
lcAppFile = lcApplicationName + '.app'
Dir (lcAppFile)
? Fdate(lcAppFile, 1)
lcErrorFile = lcApplicationName + '.err'
If File(lcErrorFile)
?
? ' *** ERRORS ****'
? Filetostr(lcErrorFile)
Endif
Else
Messagebox('Error locating Project file [' + lcProject + ']',16, lcApplicationName + ' - Building App')
Endif
Set Safety &lcSafety
*!* ? ""
*!* ? "Generation source code text files with FoxBin2Prg."
*!* ? " Working..."
*!* Do GoFishGenerateSCC.prg
*!* ? "Done."