Skip to content

Commit

Permalink
Into the wild.
Browse files Browse the repository at this point in the history
  • Loading branch information
edasich committed Jun 2, 2022
1 parent c99c5ab commit 2db3e5b
Show file tree
Hide file tree
Showing 20 changed files with 82 additions and 88 deletions.
8 changes: 7 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
dependencies {
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.19.0'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.4.10.2'
}
}

plugins {
id 'com.android.application' version '7.2.0' apply false
id 'com.android.library' version '7.2.0' apply false
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'java-library'
id 'org.jetbrains.kotlin.jvm'
id 'maven-publish'
id 'com.vanniktech.maven.publish'
}

java {
Expand All @@ -12,28 +12,16 @@ java {
dependencies {
implementation(Dependencies.retrofitDependency)
implementation(Dependencies.mockWebServerDependency)
implementation project(":test-resource")
implementation project(':data-test-resource')

testImplementation(Dependencies.junitDependency)
testImplementation(Dependencies.hamcrestDependency)
testImplementation(Dependencies.kotlinCoroutineTestDependency)
testImplementation(Dependencies.retrofitConverterGsonDependency)
}

task sourceJar(type: Jar) {
from sourceSets.main.allJava
}

group 'com.github.edasich.backpack.data'
version '1.0.0'

publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'com.github.edasich.backpack.data'
artifactId = 'test-mockwebserver-ext'
version = '1.0.0'
from components.java
}
jar {
manifest {
attributes 'Automatic-Module-Name': 'backpack.data.test.mockwebserver.ext'
}
}
5 changes: 5 additions & 0 deletions data-test-mockwebserver-ext/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
POM_ARTIFACT_ID=data-test-mockwebserver-ext
POM_NAME=Data: Test MockWebServer Extension
POM_DESCRIPTION=An extension module which simplified working with MockWebServer during test
POM_INCEPTION_YEAR=2022
POM_PACKAGING=jar
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
* SOFTWARE.
*/

package com.github.edasich.backpack.test.mockwebserver.ext
package com.github.edasich.backpack.data.test.mockwebserver.ext

import com.github.edasich.backpack.test.resource.readFileFromResourceFolder
import com.github.edasich.backpack.data.test.resource.readFileFromResourceFolder
import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.MockWebServer
import retrofit2.Converter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

package com.github.edasich.backpack.test.mockwebserver.ext
package com.github.edasich.backpack.data.test.mockwebserver.ext

import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

package com.github.edasich.backpack.test.mockwebserver.ext
package com.github.edasich.backpack.data.test.mockwebserver.ext

import com.google.gson.annotations.SerializedName

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

package com.github.edasich.backpack.test.mockwebserver.ext
package com.github.edasich.backpack.data.test.mockwebserver.ext

import retrofit2.Response
import retrofit2.http.GET
Expand Down
File renamed without changes.
23 changes: 23 additions & 0 deletions data-test-resource/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
plugins {
id 'java-library'
id 'org.jetbrains.kotlin.jvm'
id 'com.vanniktech.maven.publish'
}

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

dependencies {
implementation(Dependencies.okioDependency)

testImplementation(Dependencies.junitDependency)
testImplementation(Dependencies.hamcrestDependency)
}

jar {
manifest {
attributes 'Automatic-Module-Name': 'backpack.data.test.resource'
}
}
5 changes: 5 additions & 0 deletions data-test-resource/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
POM_ARTIFACT_ID=data-test-resource
POM_NAME=Data: Test Resource
POM_DESCRIPTION=A helper module which read files from resources foler during test
POM_INCEPTION_YEAR=2022
POM_PACKAGING=jar
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

package com.github.edasich.backpack.test.resource
package com.github.edasich.backpack.data.test.resource

import okio.buffer
import okio.source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

package com.github.edasich.backpack.test.resource
package com.github.edasich.backpack.data.test.resource

import org.hamcrest.MatcherAssert
import org.hamcrest.Matchers
Expand Down
41 changes: 22 additions & 19 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
SONATYPE_HOST=S01

GROUP=io.github.edasich.backpack
VERSION_NAME=1.0.0

POM_URL=https://github.com/edasich/backpack
POM_SCM_URL=https://github.com/edasich/backpack
POM_SCM_CONNECTION=scm:git:git://github.com/edasich/backpack.git
POM_SCM_DEV_CONNECTION=scm:git:git://github.com/edasich/backpack.git

POM_LICENCE_NAME=MIT
POM_LICENCE_URL=https://opensource.org/licenses/MIT
POM_LICENCE_DIST=repo

POM_DEVELOPER_ID=edasich
POM_DEVELOPER_NAME=Mehdi Jahed Manesh
POM_DEVELOPER_URL=https://github.com/edasich/

# Publishing SHA 256 and 512 hashes of maven-metadata is not supported by Sonatype and Nexus.
# See https://github.com/gradle/gradle/issues/11308 and https://issues.sonatype.org/browse/NEXUS-21802
systemProp.org.gradle.internal.publish.checksums.insecure=true

org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
4 changes: 2 additions & 2 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ dependencies {
implementation(Dependencies.retrofitDependency)
implementation(Dependencies.retrofitConverterGsonDependency)
testImplementation(Dependencies.mockWebServerDependency)
testImplementation project(":test-mockwebserver-ext")
testImplementation project(":test-resource")
testImplementation project(':data-test-mockwebserver-ext')
testImplementation project(':data-test-resource')

testImplementation(Dependencies.junitDependency)
testImplementation(Dependencies.hamcrestDependency)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@
* SOFTWARE.
*/

package com.github.edasich.backpack.data
package com.github.edasich.backpack.data.remote.rest

import com.github.edasich.backpack.data.remote.rest.model.FooApiResponse
import com.github.edasich.backpack.data.remote.rest.FooRestService
import com.github.edasich.backpack.test.mockwebserver.ext.createRestService
import com.github.edasich.backpack.test.mockwebserver.ext.enqueueResponseFromResourceFile
import com.github.edasich.backpack.data.test.mockwebserver.ext.createRestService
import com.github.edasich.backpack.data.test.mockwebserver.ext.enqueueResponseFromResourceFile
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
import okhttp3.mockwebserver.MockWebServer
Expand All @@ -53,7 +52,7 @@ class FooRestServiceTest {
@JvmField
val mockWebServerRule = MockWebServer()

private lateinit var restService : FooRestService
private lateinit var restService: FooRestService

@Before
fun setUp() {
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ dependencyResolutionManagement {
}
rootProject.name = "Backpack Data"
include ':sample'
include ':test-mockwebserver-ext'
include ':test-resource'
include ':data-test-mockwebserver-ext'
include ':data-test-resource'
35 changes: 0 additions & 35 deletions test-resource/build.gradle

This file was deleted.

0 comments on commit 2db3e5b

Please sign in to comment.