Skip to content

Commit

Permalink
Update project- and package structure
Browse files Browse the repository at this point in the history
  • Loading branch information
larsgrefer committed Nov 17, 2023
1 parent 1b011ca commit 59d3977
Show file tree
Hide file tree
Showing 24 changed files with 47 additions and 18 deletions.
1 change: 1 addition & 0 deletions autoconfigure/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dependencies {
api 'org.springframework.boot:spring-boot-autoconfigure'
implementation 'org.slf4j:slf4j-api'

optional project(':okhttp-spring-client')
optional 'org.springframework:spring-web'
optional 'org.springframework.boot:spring-boot-starter-actuator'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package io.freefair.spring.okhttp;
package io.freefair.spring.okhttp.autoconfigure;

import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.condition.NoneNestedConditions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package io.freefair.spring.okhttp;
package io.freefair.spring.okhttp.autoconfigure;

import io.freefair.spring.okhttp.ApplicationInterceptor;
import io.freefair.spring.okhttp.NetworkInterceptor;
import io.freefair.spring.okhttp.OkHttp3Configurer;
import okhttp3.*;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.freefair.spring.okhttp;
package io.freefair.spring.okhttp.autoconfigure;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.freefair.spring.okhttp;
package io.freefair.spring.okhttp.autoconfigure;

import io.freefair.spring.okhttp.client.OkHttpClientRequestFactory;
import okhttp3.OkHttpClient;
Expand All @@ -15,7 +15,7 @@
* @see RestClientAutoConfiguration
*/
@AutoConfiguration
@ConditionalOnClass({RestClientCustomizer.class, RestClient.class})
@ConditionalOnClass({RestClientCustomizer.class, RestClient.class, OkHttpClientRequestFactory.class})
@Conditional(NotReactiveWebApplicationCondition.class)
public class OkHttpRestClientAutoConfiguration {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.freefair.spring.okhttp;
package io.freefair.spring.okhttp.autoconfigure;

import io.freefair.spring.okhttp.client.OkHttpClientRequestFactory;
import lombok.AllArgsConstructor;
Expand Down Expand Up @@ -32,7 +32,7 @@
* @see RestTemplateAutoConfiguration
*/
@AutoConfiguration(before = RestTemplateAutoConfiguration.class, after = HttpMessageConvertersAutoConfiguration.class)
@ConditionalOnClass({RestTemplateCustomizer.class, RestTemplate.class})
@ConditionalOnClass({RestTemplateCustomizer.class, RestTemplate.class, OkHttpClientRequestFactory.class})
@Conditional(NotReactiveWebApplicationCondition.class)
public class OkHttpRestTemplateAutoConfiguration {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.freefair.spring.okhttp.logging;
package io.freefair.spring.okhttp.autoconfigure.logging;

import io.freefair.spring.okhttp.ApplicationInterceptor;
import io.freefair.spring.okhttp.OkHttp3AutoConfiguration;
import io.freefair.spring.okhttp.autoconfigure.OkHttp3AutoConfiguration;
import okhttp3.logging.HttpLoggingInterceptor;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.autoconfigure.AutoConfiguration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.freefair.spring.okhttp.logging;
package io.freefair.spring.okhttp.autoconfigure.logging;

import lombok.Data;
import okhttp3.logging.HttpLoggingInterceptor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.freefair.spring.okhttp.metrics;
package io.freefair.spring.okhttp.autoconfigure.metrics;

import io.freefair.spring.okhttp.OkHttpProperties;
import io.freefair.spring.okhttp.autoconfigure.OkHttpProperties;
import io.micrometer.core.instrument.binder.okhttp3.OkHttpConnectionPoolMetrics;
import io.micrometer.core.instrument.binder.okhttp3.OkHttpMetricsEventListener;
import io.micrometer.core.instrument.MeterRegistry;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.freefair.spring.okhttp.metrics;
package io.freefair.spring.okhttp.autoconfigure.metrics;

import io.micrometer.core.instrument.binder.okhttp3.OkHttpConnectionPoolMetrics;
import io.micrometer.core.instrument.binder.okhttp3.OkHttpMetricsEventListener;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
io.freefair.spring.okhttp.OkHttp3AutoConfiguration
io.freefair.spring.okhttp.OkHttpRestClientAutoConfiguration
io.freefair.spring.okhttp.OkHttpRestTemplateAutoConfiguration
io.freefair.spring.okhttp.metrics.OkHttpMetricsAutoConfiguration
io.freefair.spring.okhttp.logging.OkHttp3LoggingInterceptorAutoConfiguration
io.freefair.spring.okhttp.autoconfigure.OkHttp3AutoConfiguration
io.freefair.spring.okhttp.autoconfigure.OkHttpRestClientAutoConfiguration
io.freefair.spring.okhttp.autoconfigure.OkHttpRestTemplateAutoConfiguration
io.freefair.spring.okhttp.autoconfigure.metrics.OkHttpMetricsAutoConfiguration
io.freefair.spring.okhttp.autoconfigure.logging.OkHttp3LoggingInterceptorAutoConfiguration
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.freefair.spring.okhttp;

import io.freefair.spring.okhttp.autoconfigure.OkHttpProperties;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringBootConfiguration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.freefair.spring.okhttp;

import io.freefair.spring.okhttp.autoconfigure.OkHttp3AutoConfiguration;
import okhttp3.Cache;
import okhttp3.Dns;
import okhttp3.OkHttpClient;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.freefair.spring.okhttp.logging;

import io.freefair.spring.okhttp.autoconfigure.logging.OkHttp3LoggingInterceptorAutoConfiguration;
import okhttp3.logging.HttpLoggingInterceptor;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.freefair.spring.okhttp.metrics;

import io.freefair.spring.okhttp.autoconfigure.metrics.OkHttpMetricsAutoConfiguration;
import io.micrometer.core.instrument.MeterRegistry;
import okhttp3.EventListener;
import org.junit.jupiter.api.BeforeEach;
Expand Down
15 changes: 15 additions & 0 deletions okhttp-spring-client/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
plugins {
id 'java-library'
id "io.freefair.lombok"
id "io.freefair.javadoc-links"
id "io.freefair.maven-publish-java"
}

description = "OkHttp Spring Client"

dependencies {
implementation platform(project(":dependencies"))

api "com.squareup.okhttp3:okhttp"
api "org.springframework:spring-web"
}
2 changes: 2 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ dependencyResolutionManagement {
}
}

include 'okhttp-spring-client'

include 'dependencies'
include 'autoconfigure'
include 'starters:okhttp'
Expand Down
2 changes: 2 additions & 0 deletions starters/okhttp4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ description = "OkHttp 4 Spring Boot Starter"

dependencies {
api platform(project(":dependencies"))

api 'org.springframework.boot:spring-boot-starter'
api project(':autoconfigure')
api project(':okhttp-spring-client')
api 'com.squareup.okhttp3:okhttp'
}
2 changes: 2 additions & 0 deletions starters/okhttp5/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ description = "OkHttp 5 Spring Boot Starter"
dependencies {
api platform(project(":dependencies"))
api platform('com.squareup.okhttp3:okhttp-bom:5.0.0-alpha.11')

api 'org.springframework.boot:spring-boot-starter'
api project(':autoconfigure')
api project(':okhttp-spring-client')
api 'com.squareup.okhttp3:okhttp'
}

0 comments on commit 59d3977

Please sign in to comment.