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
5b0c7bdd
There was an error fetching the commit references. Please try again later.
Commit
5b0c7bdd
authored
4 years ago
by
Bensong Liu
Browse files
Options
Downloads
Patches
Plain Diff
bug fix
parent
987798a0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+3
-0
3 additions, 0 deletions
README.md
packageManager.go
+3
-3
3 additions, 3 deletions
packageManager.go
util.go
+8
-0
8 additions, 0 deletions
util.go
with
14 additions
and
3 deletions
README.md
+
3
−
0
View file @
5b0c7bdd
...
...
@@ -87,3 +87,6 @@ dotnet build
3.
Parallelize
`openxt sync`
with multiple fake environment.
4.
possible coreXT design issue: If
`myProject/subproject1`
requires pkgA:net472,
and
`myProject/subproject2`
requires pkgA:net451. And pkgA:1.0.1 only provides net451,
and pkgA:1.0.2 only provides net472, it booms.
This diff is collapsed.
Click to expand it.
packageManager.go
+
3
−
3
View file @
5b0c7bdd
...
...
@@ -55,7 +55,7 @@ func SyncPackages(nugetConfigPath, localRepoPath string, allDeps []dependencyIte
}
}
func
GetPackagePathFromName
(
localRepoPath
,
pkgName
string
)
(
pkgPath
string
,
err
error
)
{
func
GetPackagePathFromName
(
localRepoPath
,
pkgName
,
targetNetVer
string
)
(
pkgPath
string
,
err
error
)
{
guessBase
:=
localRepoPath
+
string
(
os
.
PathSeparator
)
+
strings
.
ToLower
(
pkgName
)
files
,
err
:=
ioutil
.
ReadDir
(
guessBase
+
string
(
os
.
PathSeparator
))
if
err
!=
nil
{
...
...
@@ -64,7 +64,7 @@ func GetPackagePathFromName(localRepoPath, pkgName string) (pkgPath string, err
maxVersion
:=
""
for
_
,
f
:=
range
files
{
if
f
.
IsDir
()
{
if
f
.
IsDir
()
&&
pathIsDir
(
f
.
Name
()
+
string
(
os
.
PathSeparator
)
+
"lib"
+
string
(
os
.
PathSeparator
)
+
targetNetVer
)
{
if
version
.
CompareSimple
(
f
.
Name
(),
maxVersion
)
>=
0
{
maxVersion
=
f
.
Name
()
}
...
...
@@ -74,7 +74,7 @@ func GetPackagePathFromName(localRepoPath, pkgName string) (pkgPath string, err
if
maxVersion
!=
""
{
return
guessBase
+
string
(
os
.
PathSeparator
)
+
maxVersion
,
nil
}
else
{
return
""
,
errors
.
New
(
"No version found for package "
+
pkgName
)
return
""
,
errors
.
New
(
"No version found for package "
+
pkgName
+
":"
+
targetNetVer
)
}
}
This diff is collapsed.
Click to expand it.
util.go
+
8
−
0
View file @
5b0c7bdd
...
...
@@ -3,6 +3,7 @@ package main
import
(
"io/ioutil"
"log"
"os"
"reflect"
"strings"
)
...
...
@@ -64,3 +65,10 @@ func guessPkgNameFromVarName(varName string) string {
return
strings
.
ReplaceAll
(
varName
[
3
:
],
"_"
,
"."
)
}
func
pathIsDir
(
path
string
)
bool
{
_
,
err
:=
os
.
Stat
(
path
)
if
err
==
nil
{
return
true
}
if
os
.
IsNotExist
(
err
)
{
return
false
}
return
false
}
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