Skip to content

Commit

Permalink
WIP adjusts in gradle stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
pasimoes committed Feb 4, 2022
1 parent 9f39e52 commit 77da320
Show file tree
Hide file tree
Showing 13 changed files with 532 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# These are explicitly windows files and should use crlf
*.bat text eol=crlf

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ mvnw.cmd
.java-version

target/
build/

.dccache
39 changes: 30 additions & 9 deletions build.gradle → build.gradle_org
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ allprojects {
}

ext {
gradleVersion = "5.0"
gradleVersion = "7.3"
minJavaVersion = "8"
targetJavaVersion = "11"

mavenUrl = project.hasProperty('mavenUrl') ? project.mavenUrl : ''
mavenUsername = project.hasProperty('mavenUsername') ? project.mavenUsername : ''
Expand All @@ -44,7 +45,7 @@ subprojects {
apply plugin : 'java-library'

sourceCompatibility = minJavaVersion
targetCompatibility = minJavaVersion
targetCompatibility = targetJavaVersion

jar {
from "$rootDir/LICENSE"
Expand All @@ -65,12 +66,17 @@ project(':clients') {
compile group: 'javax.jms', name: 'javax.jms-api', version: '2.0'
compile group: 'org.slf4j', name: 'slf4j-api', version: '2.0.0-alpha0'
compile group: 'com.oracle.database.messaging', name: 'aqapi', version: '19.3.0.0'
testImplementation group: 'org.easymock', name: 'easymock', version: '3.6'
testImplementation group: 'org.powermock', name: 'powermock-module-junit4', version: '2.0.0-beta.5'
testImplementation group: 'org.powermock', name: 'powermock-api-support', version: '2.0.5'
testImplementation group: 'org.powermock', name: 'powermock-api-easymock', version: '2.0.0-beta.5'
// testImplementation group: 'org.easymock', name: 'easymock', version: '3.6'
// testImplementation group: 'org.powermock', name: 'powermock-module-junit4', version: '2.0.0-beta.5'
// testImplementation group: 'org.powermock', name: 'powermock-api-support', version: '2.0.5'
// testImplementation group: 'org.powermock', name: 'powermock-api-easymock', version: '2.0.0-beta.5'
compile fileTree(dir: 'libs', include: ['*.jar'])

testImplementation('org.easymock:easymock:4.3')
testImplementation('org.powermock:powermock-module-junit4:2.0.9')
testImplementation('org.powermock:powermock-api-support:2.0.9')
testImplementation('org.powermock:powermock-api-easymock:2.0.9')

}

jar {
Expand Down Expand Up @@ -102,21 +108,36 @@ project(':clients') {

}

project(':examples') {
project(':examples:consumer') {

dependencies {
compile project(':clients')
}
jar {
description 'Generates a jar containg examples for okafka client demo'
baseName = 'okafka-examples'
description 'Generates a jar containg examples for okafka client consumer demo'
baseName = 'okafka-examples-consumer'
version = '0.8'
}
javadoc {
enabled = false
}
}

project(':examples:producer') {

dependencies {
compile project(':clients')
}
jar {
description 'Generates a jar containg examples for okafka client producer demo'
baseName = 'okafka-examples-producer'
version = '0.8'
}
javadoc {
enabled = false
}
}

apply plugin: 'java'

configurations {
Expand Down
94 changes: 94 additions & 0 deletions clients/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/*
** OKafka Java Client version 0.8.
**
** Copyright (c) 2019, 2022 Oracle and/or its affiliates.
** Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

plugins {
// Apply the application plugin to add support for building a Java library.
id 'java-library'
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

group = 'org.oracle.okafka'
version = '0.8'

repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}

dependencies {
// Test dependencies
testImplementation('org.easymock:easymock:4.3')
testImplementation('org.powermock:powermock-module-junit4:2.0.9')
testImplementation('org.powermock:powermock-api-support:2.0.9')
testImplementation('org.powermock:powermock-api-easymock:2.0.9')

// These dependencies are used by the application.
implementation('com.oracle.ojdbc:ojdbc10:19.3.0.0')
implementation('com.oracle.database.messaging:aqapi:19.3.0.0')
implementation('javax.transaction:jta:1.1')
implementation('javax.jms:javax.jms-api:2.0.1')
implementation('org.slf4j:slf4j-api:1.7.35')
}


javadoc {
include "**/org/oracle/okafka/clients/admin/*"
include "**/org/oracle/okafka/clients/consumer/*"
include "**/org/oracle/okafka/clients/producer/*"
include "**/org/oracle/okafka/common/*"
include "**/org/oracle/okafka/common/annotation/*"
include "**/org/oracle/okafka/common/errors/*"
include "**/org/oracle/okafka/common/resource/*"
include "**/org/oracle/okafka/common/serialization/*"
include "**/org/oracle/okafka/common/config/*"
}

tasks.named('jar') {
description('Generates okafka client jar ')
archiveBaseName = 'okafka'
manifest {
attributes('Implementation-Title' : 'okafka',
'Implementation-Version': project.version)
}
from "$rootDir/LICENSE.txt"
from "$rootDir/NOTICE.txt"
}

tasks.register('fullJar', Jar) {
archiveBaseName = 'okafka'
archiveClassifier = 'dependencies'

manifest {
attributes('Implementation-Title' : 'okafka',
'Implementation-Version': project.version)
}

from "$rootDir/LICENSE.txt"
from "$rootDir/NOTICE.txt"

from sourceSets.main.output

dependsOn configurations.runtimeClasspath
from {
configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
}

duplicatesStrategy 'exclude'
}

tasks.withType(Javadoc) {
// disable the crazy super-strict doclint tool in Java 8
// noinspection SpellCheckingInspection
options.addStringOption('Xdoclint:none', '-quiet')
options.windowTitle = "Oracle Database Transactional Event Queues Java API Reference"
options.header = """<b>Oracle&reg; Database Transactional Event Queues Java API Reference<br>20c</b><br>F30355-02<br>"""
options.bottom = """<center><small>Copyright &copy; 2001, 2020, Oracle and/or its affiliates. All rights reserved.<small></center><p><small><br></small></p>"""
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public ConfigEntry(String name, String value) {
* @param isReadOnly whether the config is read-only and cannot be updated
* @deprecated since 1.1.0. This constructor will be removed in a future release.
*/
//TODO return to this point to document when open the PR
@Deprecated
public ConfigEntry(String name, String value, boolean isDefault, boolean isSensitive, boolean isReadOnly) {
this(name,
value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,10 @@ public void testTopicRefreshInMetadata() throws Exception {
public void run() {
long startTimeMs = System.currentTimeMillis();
for (int i = 0; i < 10; i++) {
while (!metadata.updateRequested() && System.currentTimeMillis() - startTimeMs < 1000)
yield();
while (!metadata.updateRequested() && System.currentTimeMillis() - startTimeMs < 1000) {
//TODO return to this issue.
//syield();
}
metadata.update(Cluster.empty(), Collections.singleton(topic), time.milliseconds());
time.sleep(60 * 1000L);
}
Expand Down
33 changes: 33 additions & 0 deletions examples/consumer/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
** OKafka Java Client version 0.8.
**
** Copyright (c) 2019, 2022 Oracle and/or its affiliates.
** Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

plugins {
// Apply the application plugin to add support for building a Java App.
id 'java'
}

version = '0.8'

repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}

dependencies {
// These dependencies are used by the application.
implementation project(':clients')
}

tasks.named('jar') {
description('Generates okafka client consumer jar ')
archiveBaseName = 'okafka'
archiveClassifier = 'consumer'
manifest {
attributes('Implementation-Title' : 'okafka consumer',
'Implementation-Version': project.version)
}
}
33 changes: 33 additions & 0 deletions examples/producer/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
** OKafka Java Client version 0.8.
**
** Copyright (c) 2019, 2022 Oracle and/or its affiliates.
** Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

plugins {
// Apply the application plugin to add support for building a Java App.
id 'java'
}

version = '0.8'

repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}

dependencies {
// These dependencies are used by the application.
implementation project(':clients')
}

tasks.named('jar') {
description('Generates okafka client producer jar ')
archiveBaseName = 'okafka'
archiveClassifier = 'producer'
manifest {
attributes('Implementation-Title' : 'okafka producer',
'Implementation-Version': project.version)
}
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 77da320

Please sign in to comment.