-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Evaluate Package Attributes from source
Currently if the evaluation of a version property contains a reference to a package attribute this fails in the initial phase because bnd requires the classfiles to be present in such case it is read from an package-info annotated file. This now uses the SourceCodeAnalyzerPlugin to recover this information from the java source files. (cherry picked from commit 9eb105a)
- Loading branch information
1 parent
d37ccb3
commit 7b86f6d
Showing
5 changed files
with
76 additions
and
14 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
tycho-bndlib/src/main/java/org/eclipse/tycho/bndlib/JdtProjectBuilder.java
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,37 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2025 Christoph Läubrich and others. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Christoph Läubrich - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.tycho.bndlib; | ||
|
||
import aQute.bnd.build.Project; | ||
import aQute.bnd.build.ProjectBuilder; | ||
|
||
/** | ||
* A project builder that injects information from the sources into the builder | ||
*/ | ||
public class JdtProjectBuilder extends ProjectBuilder { | ||
|
||
public JdtProjectBuilder(Project project) { | ||
super(project); | ||
addBasicPlugin(new SourceCodeAnalyzerPlugin()); | ||
} | ||
|
||
@Override | ||
public String _packageattribute(String[] args) { | ||
SourceCodeAnalyzerPlugin analyzerPlugin = getPlugin(SourceCodeAnalyzerPlugin.class); | ||
try { | ||
analyzerPlugin.analyzeJar(this); | ||
} catch (Exception e) { | ||
} | ||
return super._packageattribute(args); | ||
} | ||
} |
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