Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

Commit

Permalink
Replace OkHttp, Retrofit and SimpleXML libraries with the ones built-in
Browse files Browse the repository at this point in the history
  • Loading branch information
ayltai committed Feb 9, 2021
1 parent 35285ce commit 4b535c4
Show file tree
Hide file tree
Showing 59 changed files with 657 additions and 899 deletions.
72 changes: 39 additions & 33 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,66 +8,72 @@ plugins {
}

group 'com.github.ayltai'
version '3.3.1'
version '3.3.2'

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
jcenter()
mavenCentral()
maven { url 'https://dl.bintray.com/mockito/maven' }
}

ext {
retrofitVersion = '2.9.0'
lombokVersion = '1.18.18'
junitVersion = '5.7.1'
awsSdkVersion = '1.11.950'
awsLambdaCoreVersion = '1.2.1'
awsLambdaEventsVersion = '3.7.0'
jacksonVersion = '2.12.1'
gsonVersion = '2.8.6'
jsonVersion = '20201115'
lombokVersion = '1.18.18'
spotBugsVersion = '4.2.1'
jetBrainsVersion = '20.1.0'
junitVersion = '5.7.1'
mockitoVersion = '3.7.15'
}

configurations {
all {
resolutionStrategy {
force "com.fasterxml.jackson.core:jackson-core:$jacksonVersion"
force "com.fasterxml.jackson.dataformat:jackson-databind:$jacksonVersion"
force "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:$jacksonVersion"
}
}

compileOnly {
extendsFrom annotationProcessor
}
}

dependencies {
// AWS SDK libraries
implementation platform('com.amazonaws:aws-java-sdk-bom:1.11.948')
implementation platform("com.amazonaws:aws-java-sdk-bom:$awsSdkVersion")
implementation 'com.amazonaws:aws-java-sdk-dynamodb'
implementation 'com.amazonaws:aws-java-sdk-s3'

// AWS Lambda libraries
implementation 'com.amazonaws:aws-lambda-java-core:1.2.1'
implementation 'com.amazonaws:aws-lambda-java-events:3.7.0'
runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.2.0'

// HTTP networking
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-scalars:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-simplexml:$retrofitVersion"
implementation "com.amazonaws:aws-lambda-java-core:$awsLambdaCoreVersion"
implementation "com.amazonaws:aws-lambda-java-events:$awsLambdaEventsVersion"

// JSON and XML
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'org.json:json:20201115'
implementation 'org.simpleframework:simple-xml:2.7.1'

// Utilities
implementation 'org.apache.commons:commons-lang3:3.11'
compileOnly 'org.jetbrains:annotations:20.1.0'
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.2.0'
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion"
implementation "com.google.code.gson:gson:$gsonVersion"
implementation "org.json:json:$jsonVersion"

// Code generation
compileOnly "org.projectlombok:lombok:$lombokVersion"
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
testCompileOnly "org.projectlombok:lombok:$lombokVersion"
testAnnotationProcessor "org.projectlombok:lombok:$lombokVersion"

// Utilities
compileOnly "com.github.spotbugs:spotbugs-annotations:$spotBugsVersion"
compileOnly "org.jetbrains:annotations:$jetBrainsVersion"
testCompileOnly "org.jetbrains:annotations:$jetBrainsVersion"

// Unit testing
testImplementation 'org.mockito:mockito-core:3.7.13'
testImplementation 'com.amazonaws:aws-lambda-java-tests:1.0.0'
testImplementation "org.mockito:mockito-core:$mockitoVersion"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
}
Expand Down Expand Up @@ -100,7 +106,7 @@ tasks.withType(Checkstyle) {
//region SpotBugs

spotbugs {
toolVersion.set('4.2.0')
toolVersion.set(spotBugsVersion)
ignoreFailures.set(true)
excludeFilter.set(file('./spotbugs-exclude.xml'))

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
110 changes: 53 additions & 57 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@
"@testing-library/user-event": "^12.6.3",
"cross-env": "^7.0.3",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.5",
"enzyme-adapter-react-16": "^1.15.6",
"eslint": "^7.19.0",
"react-app-rewired": "^2.1.8",
"react-scripts": "^4.0.2",
"react-test-renderer": "^16.14.0",
"serve": "^11.3.2"
},
"dependencies": {
"@material-ui/core": "^4.11.2",
"@material-ui/core": "^4.11.3",
"@material-ui/icons": "^4.11.2",
"prop-types": "^15.7.2",
"ra-core": "^3.12.0",
"ra-i18n-polyglot": "^3.12.0",
"ra-language-english": "^3.12.0",
"ra-core": "^3.12.1",
"ra-i18n-polyglot": "^3.12.1",
"ra-language-english": "^3.12.1",
"react": "^16.14.0",
"react-admin": "^3.12.0",
"react-admin": "^3.12.1",
"react-detect-offline": "^2.4.1",
"react-dom": "^16.14.0",
"react-image-lightbox": "^5.1.1",
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/com/github/ayltai/hknews/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,19 @@

@AllArgsConstructor(access = AccessLevel.PRIVATE)
public class Configuration {
public static final Configuration DEFAULT = new Configuration(4, 30, 60, 60, 4, "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:85.0) Gecko/20100101 Firefox/85.0", 7, 1, 10, "Hongkong", 900_000L);
public static final Configuration DEFAULT = new Configuration(512, 30, 30, 4, "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:85.0) Gecko/20100101 Firefox/85.0", 7, 1, 10, "Hongkong", 900_000L);

@Getter
@Setter
private int connectionPoolSize;

@Getter
@Setter
private int connectTimeout;
private int socketTimeout;

@Getter
@Setter
private int readTimeout;

@Getter
@Setter
private int writeTimeout;
private int connectTimeout;

@Getter
@Setter
Expand Down
Loading

0 comments on commit 4b535c4

Please sign in to comment.