Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
auto-gpr-with: do not add default project file for extern crates
  • Loading branch information
Fabien-Chouteau committed Jul 1, 2020
1 parent 1bcf7e3 commit afd9b34
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/alire/alire-releases.adb
Expand Up @@ -385,7 +385,12 @@ package body Alire.Releases is
Props_To_Strings (R.All_Properties (P), Project_File);
Without : Utils.String_Vector;
begin
if With_Paths.Is_Empty then
if With_Paths.Is_Empty
and then
R.Origin.Kind not in Origins.External | Origins.System
then
-- Default project file if no one is specified by the crate. Only if
-- the create is not external nor system.
With_Paths.Append (String'((+R.Name) & ".gpr"));
end if;

Expand Down
@@ -0,0 +1,11 @@
[general]
description = "Some external crate for testing"
maintainers = ["example@example.com"]
maintainers-logins = ["example"]
licenses = []

[[external]]
kind = "system"

[external.origin.'case(distribution)']
'...' = ["make"]
7 changes: 6 additions & 1 deletion testsuite/tests/workflows/auto-gpr-with/test.py
Expand Up @@ -36,9 +36,14 @@

# Get a dependency with auto-gpr-with=false
run_alr('with', 'libhello_nogprwith')

# Build again, the build would fail if the project file from libhello_nogprwith
# is wrongly withed.
run_alr('build')

# Get an external dependency
run_alr('with', 'extern')
# Build again, the build would fail if a default project file is added for
# external crates.
run_alr('build')

print('SUCCESS')

0 comments on commit afd9b34

Please sign in to comment.