[DEVELOPMENT ENVIRONMENT]

* NEW: Add an hidden  command-line option to update a project version only.


git-svn-id: svn://localhost/gambas/trunk@6545 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2014-10-13 15:30:40 +00:00
parent 739f02cd40
commit 6fdbac285d

View file

@ -97,6 +97,7 @@ Public ProfileIndex As Integer
Public BreakOnError As Boolean
Public Running As Boolean
Public JustUpdateVersion As Boolean
'Private Recent As New String[]
'Private RecentDate As New Date[]
@ -270,6 +271,13 @@ Public Sub Main()
Else If sArg = "--version" Or If sArg = "-V" Then
Print Application.Version
Quit
Else If sArg = "-u" Then
Project.JustUpdateVersion = True
Project.Dir = Args[iInd + 1]
Project.Path = Project.Dir &/ PROJECT_FILE
Project.ReadProject(False)
Project.Exit
Quit
Else If Left(sArg) = "-" Then
Error "gambas3: unknown option: " & sArg
Quit
@ -3197,11 +3205,15 @@ Public Sub ReadProject(Optional bConvert As Boolean)
Startup = sVal
Case "component"
hComp = CComponent.All[sVal]
If hComp And If Not hComp.Hidden Then
If JustUpdateVersion Then
Components.Add(sVal)
Else
aMissing.Add(sVal)
hComp = CComponent.All[sVal]
If hComp And If Not hComp.Hidden Then
Components.Add(sVal)
Else
aMissing.Add(sVal)
Endif
Endif
Case "library"
@ -3425,6 +3437,7 @@ Public Sub ReadProject(Optional bConvert As Boolean)
Close hFic
VersionFile = Not GetVersion(True)
If JustUpdateVersion Then Return
If aMissing.Count Then
sMsg = Subst(("Some components are missing: &1"), aMissing.Join(", "))
@ -3480,17 +3493,21 @@ Public Sub WriteProject(Optional bComponentDoNotChange As Boolean, Optional bMak
If Project.ReadOnly Then Return
If Type
' If bMakeShortcut Then
' If Project.CreateShortcut Then
' InstallComponent
' Else
' UninstallComponent
' Endif
' Endif
Else
MakeShortcut(bMakeShortcut)
If Not bComponentDoNotChange Then RefreshComponents
If Not JustUpdateVersion Then
If Type
' If bMakeShortcut Then
' If Project.CreateShortcut Then
' InstallComponent
' Else
' UninstallComponent
' Endif
' Endif
Else
MakeShortcut(bMakeShortcut)
If Not bComponentDoNotChange Then RefreshComponents
Endif
Endif
' Creates the .project file
@ -3581,6 +3598,8 @@ Public Sub WriteProject(Optional bComponentDoNotChange As Boolean, Optional bMak
Try Kill sPath
Move sPath & ".tmp" To sPath
If JustUpdateVersion Then Return
WriteProjectTranslation
UpdateComponentFile