drom icon indicating copy to clipboard operation
drom copied to clipboard

Skeleton project with no package

Open tachukao opened this issue 3 years ago • 4 comments

Is there any way to write a skeleton for a project which does not automatically generate a package inside src with the name of the project? Thanks!

tachukao avatar Jan 29 '21 20:01 tachukao

The ´virtual’ skeleton might be what you are looking for.

Le ven. 29 janv. 2021 à 21:48, tachukao [email protected] a écrit :

Is there any way to write a skeleton for a project which does not automatically generate a package inside src with the name of the project? Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/OCamlPro/drom/issues/126, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD5XDM27R2P7SU7L75QKGLS4MNI5ANCNFSM4WZQKFIA .

-- Fabrice LE FESSANT Chercheur en Informatique INRIA Paris Rocquencourt -- OCamlPro Programming Languages and Distributed Systems

lefessan avatar Jan 30 '21 14:01 lefessan

@lefessan thanks for the fast reply.

I tried creating the following test project and package skeletons:

packages/test/skeleton.toml:

[skeleton]
name = "test"

packages/test/package.toml:

name = "!{name}"
skeleton = "test"
kind = "virtual"

projects/test/skeleton.toml:

[skeleton]
name = "test"

projects/test/drom.toml:

[project]
drom-version = "0.1.0"

[project]
authors = [ !{authors-for-toml} ]
copyright = "!{copyright}"
name = "!{name}"
synopsis = "The !{name} project"
version = "0.1.0"

[drom]
skip = ""

[project]
skip-dirs = []

[[package]]
skeleton = "test"
kind = "virtual"
name = "!{name}" 

When I then run drom new test --skeleton=test, I get the following directory structure:

└── test/
    ├── .drom             (drom state, do not edit)
    ├── drom.toml    <────────── project config EDIT !
    └── src/
        └── test/
            └── package.toml    <────────── package config EDIT !

Ideally, I would like to get

└── test/
    ├── .drom             (drom state, do not edit)
    └── drom.toml    <────────── project config EDIT !

Is that possible? thanks!

tachukao avatar Jan 30 '21 15:01 tachukao

I see two ways to avoid this : one is just to not add a package.toml file in your project, have no predefined package. The second one is to set the dir variable in the package.toml file to something different, i.e. "." for example.

lefessan avatar Feb 01 '21 12:02 lefessan

The second method works for me thanks! It still creates a package.toml file in . but that will work.

The first method was a bit confusing to me. I never had a package.toml inside the test project. However, removing it from within the test package doesn't seem to work either as a package.toml file is still created. In any case, I'm happy with the second method, thanks again!

tachukao avatar Feb 02 '21 07:02 tachukao