Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version of source feature not substituted #20

Closed
missedone opened this issue Oct 21, 2016 · 2 comments
Closed

version of source feature not substituted #20

missedone opened this issue Oct 21, 2016 · 2 comments

Comments

@missedone
Copy link
Contributor

hi @stempler
we're OSGifying testng, project is here.

for the snapshot version, it will be replaced with timestamp qualifier:

platform {
    feature(id: 'org.testng.p2.feature', name: 'TestNG Feature') {
        plugin "org.testng:testng:${version}", {
            bnd {
                optionalImport 'com.google.common.*'
            }
            exclude module: 'ant'
        }
    }

    featureId 'org.testng.p2.feature'
    featureName 'TestNG Feature'
    featureVersion versionWithQualifier

    categoryName 'TestNG Libraries'
    categoryId 'org.testng.p2.libraries'

    useBndHashQualifiers false
    defaultQualifier ''

    bnd(group: 'org.testng', name: 'testng', version: "${version}") {
        version = versionWithQualifier
    }
}

but one thing i noticed, the source feature version is not substituted (still be '-SNAPSHOT'), org.testng.p2.feature.source_6.9.13.SNAPSHOT-bnd-hApQA.jar:

ll build/updatesite/*
-rw-r--r-- 1 nick staff 1.1K Oct 21 04:15 build/updatesite/artifacts.jar
-rw-r--r-- 1 nick staff 2.2K Oct 21 04:15 build/updatesite/content.jar

build/updatesite/features:
total 8.0K
-rw-r--r-- 1 nick staff 419 Oct 21 04:15 org.testng.p2.feature.source_6.9.13.SNAPSHOT-bnd-hApQA.jar
-rw-r--r-- 1 nick staff 453 Oct 21 04:15 org.testng.p2.feature_6.9.13.20161021110925-bnd-9RzSQ.jar

build/updatesite/plugins:
total 2.1M
-rw-r--r-- 1 nick staff  55K Oct 21 04:15 com.beust.jcommander.source_1.48.0.jar
-rw-r--r-- 1 nick staff  63K Oct 21 04:15 com.beust.jcommander_1.48.0.jar
-rw-r--r-- 1 nick staff 296K Oct 21 04:15 org.apache-extras.beanshell.bsh.source_2.0.0.b6.jar
-rw-r--r-- 1 nick staff 385K Oct 21 04:15 org.apache-extras.beanshell.bsh_2.0.0.b6.jar
-rw-r--r-- 1 nick staff 476K Oct 21 04:15 org.testng.source_6.9.13.20161021110925.jar
-rw-r--r-- 1 nick staff 840K Oct 21 04:15 org.testng_6.9.13.20161021110925.jar

did I missing anything, or it's a bug?

@stempler
Copy link
Owner

You are actually configuring two different features here. the configuration probably clashes because you use the same feature ID for both.

This configures the overall feature for the whole p2 repo, that is always created:

featureId 'org.testng.p2.feature'
featureName 'TestNG Feature'
featureVersion versionWithQualifier

This defines a feature based on the scope of plugins configured in the closure:

feature(id: 'org.testng.p2.feature', name: 'TestNG Feature') {
  ...

You can try two things:

  • Remove the feature definition above and instead of with plugin declare the dependency using bundle directly in platform or
  • Change the id you provide for the feature definition and provide a specific version for that feature

Note that there is also a setting useFeatureHashQualifiers if you don't want the hash qualifiers for features.

@missedone
Copy link
Contributor Author

missedone commented Oct 21, 2016

thanks for the clarification, I thought feature(id: 'org.testng.p2.feature', name: 'TestNG Feature') was overriding the platform's one.

now the output looks perfect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants