Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openxt
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
msc
openxt
Commits
64e84be2
There was an error fetching the commit references. Please try again later.
Commit
64e84be2
authored
4 years ago
by
Bensong Liu
Browse files
Options
Downloads
Patches
Plain Diff
bug fix
parent
61104008
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+2
-0
2 additions, 0 deletions
README.md
main.go
+5
-1
5 additions, 1 deletion
main.go
packageManager.go
+4
-1
4 additions, 1 deletion
packageManager.go
util.go
+5
-3
5 additions, 3 deletions
util.go
with
16 additions
and
5 deletions
README.md
+
2
−
0
View file @
64e84be2
...
@@ -85,3 +85,5 @@ dotnet build
...
@@ -85,3 +85,5 @@ dotnet build
2.
deps de-duplicate
2.
deps de-duplicate
3.
Parallelize
`openxt sync`
with multiple fake environment.
This diff is collapsed.
Click to expand it.
main.go
+
5
−
1
View file @
64e84be2
...
@@ -3,13 +3,17 @@ package main
...
@@ -3,13 +3,17 @@ package main
import
(
import
(
"flag"
"flag"
"fmt"
"fmt"
"log"
"os"
"os"
)
)
// Some options here
// Some options here
. Would be improved in beta release.
const
DeductPkgNameFromVarName
=
true
const
DeductPkgNameFromVarName
=
true
const
OPENXT_VERSION
=
"0.1.2a"
func
main
()
{
func
main
()
{
log
.
Println
(
"OpenXT version "
+
OPENXT_VERSION
)
nugetConfigPath
:=
"/home/recolic/tmp/test.nuget.config"
// warning: not supported yet
nugetConfigPath
:=
"/home/recolic/tmp/test.nuget.config"
// warning: not supported yet
projectDir
:=
flag
.
String
(
"project-dir"
,
""
,
"Path to the CoreXT/OpenXT project. "
)
projectDir
:=
flag
.
String
(
"project-dir"
,
""
,
"Path to the CoreXT/OpenXT project. "
)
localRepoDir
:=
flag
.
String
(
"local-repo-dir"
,
""
,
"Path to local nuget repo. (known as CxCache in CoreXT)"
)
localRepoDir
:=
flag
.
String
(
"local-repo-dir"
,
""
,
"Path to local nuget repo. (known as CxCache in CoreXT)"
)
...
...
This diff is collapsed.
Click to expand it.
packageManager.go
+
4
−
1
View file @
64e84be2
...
@@ -45,7 +45,10 @@ func SyncPackages(nugetConfigPath, localRepoPath string, allDeps []dependencyIte
...
@@ -45,7 +45,10 @@ func SyncPackages(nugetConfigPath, localRepoPath string, allDeps []dependencyIte
targetNetVer
=
"net472"
// Default dotnet version
targetNetVer
=
"net472"
// Default dotnet version
}
}
if
DeductPkgNameFromVarName
{
if
DeductPkgNameFromVarName
{
pkgName
=
varNameToPkgName
(
dep
.
envName
)
// PkgCis_SdkV2 requires this to work.
guessedName
:=
guessPkgNameFromVarName
(
dep
.
envName
)
// PkgCis_SdkV2 requires this to work.
if
guessedName
!=
""
{
pkgName
=
guessedName
}
}
}
log
.
Println
(
"DEBUG: Downloading pkg: "
+
pkgName
+
":"
+
targetNetVer
+
" as var "
+
dep
.
envName
)
log
.
Println
(
"DEBUG: Downloading pkg: "
+
pkgName
+
":"
+
targetNetVer
+
" as var "
+
dep
.
envName
)
...
...
This diff is collapsed.
Click to expand it.
util.go
+
5
−
3
View file @
64e84be2
...
@@ -55,9 +55,11 @@ func assertStringNotEmpty(s, msg string) {
...
@@ -55,9 +55,11 @@ func assertStringNotEmpty(s, msg string) {
}
}
}
}
func
varNameToPkgName
(
varName
string
)
string
{
// PkgCis_SdkV2 => Cis.SdkV2
if
varName
[
:
3
]
!=
"Pkg"
{
// On error, returns empty string.
return
"InvalidVarName_"
+
varName
func
guessPkgNameFromVarName
(
varName
string
)
string
{
if
len
(
varName
)
<=
3
||
varName
[
:
3
]
!=
"Pkg"
{
return
""
}
}
return
strings
.
ReplaceAll
(
varName
[
3
:
],
"_"
,
"."
)
return
strings
.
ReplaceAll
(
varName
[
3
:
],
"_"
,
"."
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment