PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, January 16, 2022

[FIXED] Using a custom version tag pattern\vcs path in composer.json

 January 16, 2022     composer-php, php     No comments   

Issue

I have an svn* repo that contains a collection ("MyCommonLib") of libraries eg src\LibA, src\LibB etc.

I would like to publish each Lib* as separate composer package. I've included a composer.json in each Lib* and I can point composer at each trunk\src\Lib* and it doesn't seem to mind that.... until versions are involved.

The tag structure is versioned for the whole collection tags\1.0\composer.json, which is fine per se for the collection (MCL) . However, this is not fine for Lib* as the MCL\composer.json != MCL\src\LibA\composer.json.

Ideally I "simply" want to spec in the LibA\composer.json that its "tag versions" are pulled from a specified path. I.e. tags\[version]\src\LibA\composer.json instead of the bog standard tags\[version]\composer.json

Is there anyway to do this?

*While SVN will always be in the picture, I have the ability to setup git mirrors if that helps at all.

PS This may smell like Using Composer when multiple components are in the same vcs repo but its A) been 6 years on and B) I'm specifically asking about the tag\version pattern discovery having solved the basic package discovery its self.


Solution

You may use package-path settings to specify path of package inside of repository:

"repositories": [
    {
        "type": "vcs",
        "url": "https://svn.example.org/",
        "package-path": "src/LibA/"
    }
]

Composer should use https://svn.example.org/trunk/src/LibA/composer.json, https://svn.example.org/branches/[branch name]/src/LibA/composer.json and https://svn.example.org/tags/[version]/src/LibA/composer.json as a paths for this package.

See example in documentation.



Answered By - rob006
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing