-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #477 from nevalang/third_party_path
Third party path
- Loading branch information
Showing
17 changed files
with
260 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# This directory contains working examples from Nevalang tutorial. | ||
# They not only serve documentation purposes, they are also | ||
# e2e tests that you can manually run to ensure that Nevalang works. | ||
|
||
neva: 0.6.0 | ||
neva: 0.6.0 | ||
deps: | ||
nevalang/x: | ||
path: github.com/nevalang/x | ||
version: 0.0.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
neva: 0.6.0 | ||
deps: | ||
github.com/nevalang/x: | ||
path: github.com/nevalang/x | ||
version: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package builder | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
"os" | ||
|
||
src "github.com/nevalang/neva/pkg/sourcecode" | ||
) | ||
|
||
func (b Builder) Get(workdir, path, version string) (string, error) { | ||
ref := src.ModuleRef{ | ||
Path: path, | ||
Version: version, | ||
} | ||
|
||
downloadPath, actualVersion, err := b.downloadDep(ref) | ||
if err != nil { | ||
return "", err | ||
} | ||
|
||
manifest, err := b.retrieveManifest(os.DirFS(workdir)) | ||
if err != nil { | ||
return "", fmt.Errorf("Retrieve manifest: %w", err) | ||
} | ||
|
||
existing, ok := manifest.Deps[path] | ||
if ok && existing.Version != actualVersion { | ||
return "", errors.New( | ||
"Several versions of the same dependency not yet supported.", | ||
) | ||
} | ||
|
||
manifest.Deps[path] = src.ModuleRef{ | ||
Path: path, | ||
Version: actualVersion, | ||
} | ||
|
||
if err := b.writeManifest(manifest, workdir); err != nil { | ||
return "", err | ||
} | ||
|
||
return downloadPath, nil | ||
} |
Oops, something went wrong.