forked from serj-lotutovici/moshi-lazy-adapters
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Meesho/lazy-adapters-kotlin-migration
Lazy adapters kotlin migration
- Loading branch information
Showing
55 changed files
with
881 additions
and
3,996 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,51 +1,135 @@ | ||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
maven { url 'https://jitpack.io' } | ||
} | ||
ext.kotlin_version = '1.6.21' | ||
repositories { | ||
mavenCentral() | ||
maven { | ||
url 'https://jitpack.io' | ||
} | ||
maven { | ||
url "https://plugins.gradle.org/m2/" | ||
} | ||
} | ||
|
||
// Needed to use auto-value-moshi in tests | ||
dependencies { | ||
classpath 'com.github.tbroyer:gradle-apt-plugin:v0.12' | ||
} | ||
// Needed to use auto-value-moshi in tests | ||
dependencies { | ||
classpath "net.ltgt.gradle:gradle-apt-plugin:0.21" | ||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.28.3" | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenCentral() | ||
} | ||
|
||
apply plugin: 'net.ltgt.apt-idea' | ||
apply plugin: 'kotlin' | ||
apply plugin: 'java' | ||
apply plugin: "com.jfrog.artifactory" | ||
apply plugin: "maven-publish" | ||
apply plugin: 'java-library' | ||
apply plugin: 'kotlin-kapt' | ||
|
||
apply from: rootProject.file('dependencies.gradle') | ||
apply from: rootProject.file('checkstyle.gradle') | ||
apply from: rootProject.file('jacoco.gradle') | ||
apply from: rootProject.file('gradle/gradle-mvn-push.gradle') | ||
// | ||
|
||
sourceCompatibility = javaVersion | ||
targetCompatibility = javaVersion | ||
|
||
sourceSets { | ||
// Setup source sets to split unit and integration tests | ||
test { | ||
java.srcDirs = ['src/unitTest/java', 'src/integrationTest/java'] | ||
resources.srcDirs = ['src/unitTest/resources', 'src/integrationTest/resources'] | ||
} | ||
// Setup source sets to split unit and integration tests | ||
test { | ||
java.srcDirs = ['src/unitTest/java'] | ||
resources.srcDirs = ['src/unitTest/resources'] | ||
} | ||
} | ||
|
||
dependencies { | ||
compile moshi | ||
implementation moshi | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" | ||
kapt "com.squareup.moshi:moshi-kotlin-codegen:1.13.0" | ||
|
||
testImplementation junit | ||
testImplementation assertJ | ||
testImplementation privateConstructorChecker | ||
testImplementation retrofit | ||
testImplementation retrofitMoshiConverter | ||
testImplementation mockWebServer | ||
testImplementation rxJava2 | ||
} | ||
compileKotlin { | ||
kotlinOptions { | ||
jvmTarget = "11" | ||
} | ||
} | ||
compileTestKotlin { | ||
kotlinOptions { | ||
jvmTarget = "11" | ||
} | ||
} | ||
ext.versionName = { -> | ||
def currentTag = 'git tag --points-at HEAD'.execute().in.text.toString().trim() | ||
def currentBranch = 'git rev-parse --abbrev-ref HEAD'.execute().in.text.toString().trim() | ||
def tagRegex = "[0-9.]*[0-9]" | ||
if (!currentTag.isEmpty() && currentTag.matches(tagRegex)) { | ||
// is not empty and is in following format 8.0 | ||
return currentTag | ||
} else { | ||
return currentBranch + '-SNAPSHOT' | ||
} | ||
} | ||
|
||
def libraryGroupId = 'com.meesho.android' | ||
def libraryVersion = versionName() | ||
|
||
task androidSourcesJar(type: Jar) { | ||
archiveClassifier.set('sources') | ||
from sourceSets.main.java.srcDirs | ||
} | ||
|
||
|
||
testCompile junit | ||
testCompile assertJ | ||
testCompile privateConstructorChecker | ||
testCompile retrofit | ||
testCompile retrofitMoshiConverter | ||
testCompile mockWebServer | ||
testCompile rxJava2 | ||
artifactoryPublish.dependsOn('build') | ||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
groupId = libraryGroupId | ||
artifactId = 'moshi-lazy-adapters' | ||
version = libraryVersion | ||
// Tell maven to prepare the generated "*.jar" file for publishing | ||
artifact("$buildDir/libs/moshi-lazy-adapters.jar") | ||
artifact androidSourcesJar | ||
|
||
// This is needed to test integration with auto-value-moshi | ||
testCompileOnly autoValueMoshiAnnotations | ||
testCompileOnly autoValueAnnotations | ||
testApt autoValueMoshi | ||
pom.withXml { | ||
def dependencies = asNode().appendNode('dependencies') | ||
configurations.implementation.allDependencies.each { | ||
def dependency = dependencies.appendNode('dependency') | ||
dependency.appendNode('groupId', it.group) | ||
dependency.appendNode('artifactId', it.name) | ||
dependency.appendNode('version', it.version) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
artifactory { | ||
//The base Artifactory URL if not overridden by the publisher/resolver | ||
contextUrl = project.properties["JFROG_ARTIFACTORY_URL"] | ||
publish { | ||
repository { | ||
repoKey = libraryVersion.endsWith('-SNAPSHOT') ? project.properties["SNAPSHOT_REPO_NAME"] : | ||
project.properties["RELEASE_REPO_NAME"] | ||
username = project.properties["JFROG_ARTIFACTORY_USERNAME"] | ||
password = project.properties["JFROG_ARTIFACTORY_KEY"] | ||
} | ||
defaults { | ||
// Tell the Artifactory Plugin which artifacts should be published to Artifactory. | ||
publications('mavenJava') | ||
publishArtifacts = true | ||
// Publish generated POM files to Artifactory (true by default) | ||
publishPom = true | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#Mon Oct 09 10:31:26 CEST 2017 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-all.zip |
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
41 changes: 0 additions & 41 deletions
41
src/integrationTest/java/com/serjltt/moshi/adapters/Data.java
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
src/integrationTest/java/com/serjltt/moshi/adapters/DataFactories.java
This file was deleted.
Oops, something went wrong.
40 changes: 0 additions & 40 deletions
40
src/integrationTest/java/com/serjltt/moshi/adapters/DeserializeOnlyAutoValueTest.java
This file was deleted.
Oops, something went wrong.
65 changes: 0 additions & 65 deletions
65
src/integrationTest/java/com/serjltt/moshi/adapters/LazyAdaptersAutoValueTest.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.