diff --git a/consts/consts.go b/consts/consts.go index 4a5ca90..8add1d9 100644 --- a/consts/consts.go +++ b/consts/consts.go @@ -8,7 +8,6 @@ const FileBplOrder = "bpl_order.txt" const FileExtensionBpl = ".bpl" const FileExtensionDcp = ".dcp" const FileExtensionDpk = ".dpk" -const FileExtensionDproj = ".dproj" const FilePackageLockOld = "boss.lock" const FolderDependencies = "modules" @@ -38,7 +37,7 @@ const XmlTagNamePropertyAttribute string = "Condition" const XmlTagNamePropertyAttributeValue string = "'$(Base)'!=''" const XmlTagNameLibraryPath string = "DCC_UnitSearchPath" -const Version string = "v3.0.0-alpha13" +const Version string = "v3.0.0" const BossInternalDir = "internal." const BossInternalDirOld = "{internal}" diff --git a/core/compiler/executor.go b/core/compiler/executor.go index cba4803..e6e1326 100644 --- a/core/compiler/executor.go +++ b/core/compiler/executor.go @@ -62,6 +62,7 @@ func compile(dprojPath string, dep *models.Dependency, rootLock models.PackageLo readFileStr += "\n@SET DCC_UnitSearchPath=%DCC_UnitSearchPath%;" + filepath.Join(env.GetModulesDir(), consts.DcuFolder) + ";" + filepath.Join(env.GetModulesDir(), consts.DcpFolder) //+ ";" + getNewPathsDep(dep, abs) + " " + readFileStr += "\n@SET PATH=%PATH%;" + filepath.Join(env.GetModulesDir(), consts.BplFolder) + ";" for _, value := range []string{"Win32"} { readFileStr += " \n msbuild \"" + project + "\" /p:Configuration=Debug " + getCompilerParameters(env.GetModulesDir(), dep, value) @@ -90,7 +91,7 @@ func compile(dprojPath string, dep *models.Dependency, rootLock models.PackageLo } } -func getNewPathsDep(dep *models.Dependency, basePath string) string { +func _(dep *models.Dependency, basePath string) string { if graphDep, err := loadOrderGraphDep(dep); err == nil { var result = filepath.Join(env.GetModulesDir(), consts.DcpFolder) + ";" for { @@ -145,7 +146,7 @@ func getPaths(path string, basePath string) string { return strings.Join(paths, ";") + ";" } -func buildDCU_(path string) { +func buildDCU(path string) { msg.Info(" Building %s", filepath.Base(path)) var unitScopes = "-NSWinapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;System;Xml;Data;Datasnap;Web" + ";Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell" diff --git a/core/gitWrapper/git_embedded.go b/core/gitWrapper/git_embedded.go index 01b3354..7f76685 100644 --- a/core/gitWrapper/git_embedded.go +++ b/core/gitWrapper/git_embedded.go @@ -34,7 +34,6 @@ func CloneCacheEmbedded(dep models.Dependency) *git.Repository { } func UpdateCacheEmbedded(dep models.Dependency) *git.Repository { - msg.Info("Updating dependency %s", dep.GetName()) storageCache := makeStorageCache(dep) repository, err := git.Open(storageCache, memfs.New()) if err != nil { diff --git a/core/gitWrapper/git_native.go b/core/gitWrapper/git_native.go index af9aa2a..75e557d 100644 --- a/core/gitWrapper/git_native.go +++ b/core/gitWrapper/git_native.go @@ -30,7 +30,6 @@ func CloneCacheNative(dep models.Dependency) *git2.Repository { } func UpdateCacheNative(dep models.Dependency) *git2.Repository { - msg.Info("Updating dependency %s", dep.GetName()) getWrapperFetch(dep) return GetRepository(dep) } diff --git a/core/installer/vsc.go b/core/installer/vsc.go index 0723451..bc41031 100644 --- a/core/installer/vsc.go +++ b/core/installer/vsc.go @@ -15,8 +15,10 @@ var updatedDependencies []string func GetDependency(dep models.Dependency) { if utils.Contains(updatedDependencies, dep.GetHashName()) { - msg.Debug("Using cached of %s", dep.Repository) + msg.Debug("Using cached of %s", dep.GetName()) return + } else { + msg.Info("Updating cache of dependency %s", dep.GetName()) } updatedDependencies = append(updatedDependencies, dep.GetHashName()) diff --git a/env/configuration.go b/env/configuration.go index be7ae61..5e7cfd5 100644 --- a/env/configuration.go +++ b/env/configuration.go @@ -21,7 +21,7 @@ type Configuration struct { path string Key string `json:"id"` Auth map[string]*Auth `json:"auth"` - PurgeTime int `json:"purgeAfter"` + PurgeTime int `json:"purge_after"` InternalRefreshRate int `json:"internal_refresh_rate"` LastPurge time.Time `json:"last_purge_cache"` LastInternalUpdate time.Time `json:"last_internal_update"` diff --git a/setup/migrations.go b/setup/migrations.go index d717885..9c03131 100644 --- a/setup/migrations.go +++ b/setup/migrations.go @@ -2,7 +2,9 @@ package setup import ( "github.com/hashload/boss/consts" + "github.com/hashload/boss/core/installer" "github.com/hashload/boss/env" + "github.com/hashload/boss/models" "github.com/hashload/boss/msg" "github.com/hashload/boss/utils" "os" @@ -10,8 +12,8 @@ import ( "time" ) -func incVersion() { - env.GlobalConfiguration.ConfigVersion++ +func updateVersion(newVersion int64) { + env.GlobalConfiguration.ConfigVersion = newVersion env.GlobalConfiguration.SaveConfiguration() } @@ -23,7 +25,7 @@ func executeUpdate(version int64, update func()) { if needUpdate(version) { msg.Debug("\t\tRunning update to version %d", version) update() - incVersion() + updateVersion(version) } else { msg.Debug("\t\tUpdate to version %d already performed", version) } @@ -49,7 +51,22 @@ func migration() { env.GlobalConfiguration.GitEmbedded = true }) - executeUpdate(4, func() { + executeUpdate(5, func() { + env.Internal = false env.GlobalConfiguration.LastInternalUpdate = time.Now().AddDate(-1000, 0, 0) + modulesDir := filepath.Join(env.GetBossHome(), consts.FolderDependencies, env.HashDelphiPath()) + if _, err := os.Stat(modulesDir); os.IsNotExist(err) { + return + } + + err := os.Remove(filepath.Join(modulesDir, consts.FilePackageLock)) + utils.HandleError(err) + modules, err := models.LoadPackage(false) + if err != nil { + return + } + + installer.GlobalInstall([]string{}, modules, false) + env.Internal = true }) } diff --git a/setup/setup.go b/setup/setup.go index 9e8e7bd..bf28222 100644 --- a/setup/setup.go +++ b/setup/setup.go @@ -123,7 +123,6 @@ func installModules(modules []string) { installer.GlobalInstall(modules, pkg, false) moveBptIdentifier() - } func moveBptIdentifier() { @@ -155,9 +154,9 @@ func initializeDelphiVersion() { return } - byRegisty := dcc32.GetDelphiPathsByRegisty() - if len(byRegisty) != 0 { - env.GlobalConfiguration.DelphiPath = byRegisty[len(byRegisty)-1] + byRegistry := dcc32.GetDelphiPathsByRegisty() + if len(byRegistry) != 0 { + env.GlobalConfiguration.DelphiPath = byRegistry[len(byRegistry)-1] env.GlobalConfiguration.SaveConfiguration() return } diff --git a/utils/librarypath/globalUtil.go b/utils/librarypath/globalUtil.go index 6107b95..b56de17 100644 --- a/utils/librarypath/globalUtil.go +++ b/utils/librarypath/globalUtil.go @@ -39,7 +39,7 @@ func updateGlobalLibraryPath() { utils.HandleError(err) paths, _, err := delphiPlatform.GetStringValue(SearchPathRegistry) if err != nil { - msg.Warn("Failed to update library path from platform %s with delphi %s", platform, ideVersion) + msg.Debug("Failed to update library path from platform %s with delphi %s", platform, ideVersion) continue }