Skip to content

Commit 2dd528f

Browse files
committed
#41 fixed gradle build and JBBP part embedded into plugin
1 parent 90099be commit 2dd528f

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

jbbp-plugins/jbbp-gradle/build.gradle

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
def getProp(name, defaultValue) {
2-
if (project.hasProperty(name)) {
3-
return project.getProperty(name)
4-
} else {
2+
String found = project.findProperty(name)
3+
if (found == null) {
54
logger.warn('Can not find provided property "' + name + '", default value ' + defaultValue + ' in use')
65
return defaultValue
6+
} else {
7+
return project.getProperty(name)
78
}
89
}
910

@@ -25,7 +26,7 @@ dependencies {
2526
implementation localGroovy()
2627

2728
implementation 'commons-io:commons-io:2.11.0'
28-
implementation "com.igormaznitsa:jbbp:" + jbbpVersion
29+
implementation ('com.igormaznitsa:jbbp:' + jbbpVersion) { transitive = true }
2930

3031
implementation "com.igormaznitsa:meta-annotations:" + metaLibVersion
3132
implementation "com.igormaznitsa:meta-utils:" + metaLibVersion
@@ -58,6 +59,7 @@ task sourcesJar(type: Jar) {
5859
sourceSets {
5960
main {
6061
java {
62+
srcDirs '../../jbbp/src/main/java'
6163
srcDirs 'src/main/java'
6264
srcDirs '../jbbp-plugin-common/src/main/java'
6365
}
@@ -79,4 +81,12 @@ gradlePlugin {
7981
implementationClass = 'com.igormaznitsa.jbbp.plugin.gradle.JBBPPlugin'
8082
}
8183
}
84+
}
85+
86+
publishing {
87+
publications {
88+
maven(MavenPublication) {
89+
from components.java
90+
}
91+
}
8292
}

jbbp-plugins/jbbp-gradle/pom.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,14 @@
104104
<configuration>
105105
<executable>${gradle.executable}</executable>
106106
<arguments>
107+
<argument>clean</argument>
108+
<argument>build</argument>
107109
<argument>${gradleGoal}</argument>
108110
<argument>--info</argument>
109111
<argument>--scan</argument>
110112
<argument>--no-daemon</argument>
111-
<argument>-Djbbp_plugin_version=${project.version}</argument>
113+
<argument>-Pjbbp_plugin_version=${project.version}</argument>
114+
<argument>-Pmeta_lib_version=${meta.version}</argument>
112115
</arguments>
113116
</configuration>
114117
<goals>

jbbp-plugins/jbbp-gradle/src/main/java/com/igormaznitsa/jbbp/plugin/gradle/JBBPGenerateTask.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ public class JBBPGenerateTask extends AbstractJBBPTask {
4141
* Flag to register the output folder in Java source folders at the end of process.
4242
*/
4343
@Input
44-
@Optional
4544
protected boolean addSource = true;
4645

4746
public boolean isAddSource() {

0 commit comments

Comments
 (0)