diff --git a/build.gradle b/build.gradle index 8e9824ed..4ab09216 100644 --- a/build.gradle +++ b/build.gradle @@ -8,6 +8,7 @@ configurations { buildscript { ext { kotlin = '1.3.50' + kotlin_version = '1.3.50' } repositories { google() diff --git a/commits/build.gradle b/commits/build.gradle new file mode 100644 index 00000000..8a26de65 --- /dev/null +++ b/commits/build.gradle @@ -0,0 +1,62 @@ +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' +apply plugin: 'kotlin-kapt' + + +android { + def conf = rootProject.ext.android + + compileSdkVersion conf.compileSdkVersion + + defaultConfig { + minSdkVersion conf.minSdkVersion + targetSdkVersion conf.targetSdkVersion + versionCode conf.versionCode + versionName conf.versionName + multiDexEnabled + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + javaCompileOptions { + annotationProcessorOptions { + includeCompileClasspath = true + } + } + } + + compileOptions { + sourceCompatibility 1.8 + targetCompatibility 1.8 + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + +} + +dependencies { + def dependency = rootProject.ext + + implementation fileTree(dir: 'libs', include: ['*.jar']) + + implementation project(':data') + implementation project(':domain') + implementation project(':resources') + implementation project(':extensions') + implementation project(':markdown') + implementation project(':editor') + implementation dependency.kotlin + implementation dependency.supportLibraries + implementation dependency.extrasLibraries + implementation dependency.networking + implementation dependency.rxJava + implementation dependency.extrasLibraries + implementation dependency.dagger + implementation dependency.archs + implementation dependency.firebase + + kapt dependency.processing + +} diff --git a/commits/consumer-rules.pro b/commits/consumer-rules.pro new file mode 100644 index 00000000..e69de29b diff --git a/commits/proguard-rules.pro b/commits/proguard-rules.pro new file mode 100644 index 00000000..f1b42451 --- /dev/null +++ b/commits/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/commits/src/main/AndroidManifest.xml b/commits/src/main/AndroidManifest.xml new file mode 100644 index 00000000..71d72b90 --- /dev/null +++ b/commits/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + diff --git a/data/src/main/graphql/github/fragments.graphql b/data/src/main/graphql/github/fragments.graphql index 1177b8ad..776a0432 100644 --- a/data/src/main/graphql/github/fragments.graphql +++ b/data/src/main/graphql/github/fragments.graphql @@ -89,6 +89,35 @@ fragment CommitFragment on Commit { } } +fragment FullCommitFragment on Commit { + abbreviatedOid + id + oid + commitUrl + additions + deletions + changedFiles + author { + avatarUrl + name + user { + login + avatarUrl + url + } + } + committedDate + committedViaWeb + status { + state + } + signature { + isValid + state + } + messageHeadline +} + fragment FullIssue on Issue { id databaseId @@ -414,4 +443,11 @@ fragment Transferred on TransferredEvent { number url } +} + +fragment PageInfoFragment on PageInfo { + endCursor + hasNextPage + hasPreviousPage + startCursor } \ No newline at end of file diff --git a/data/src/main/graphql/github/issues_prs.graphql b/data/src/main/graphql/github/issues_prs.graphql index c2101ed1..6b697413 100644 --- a/data/src/main/graphql/github/issues_prs.graphql +++ b/data/src/main/graphql/github/issues_prs.graphql @@ -503,4 +503,24 @@ query getMilestones($login: String!, $repo: String!, $page: String) { } } } +} + +query getPullRequestCommits($login: String!, $repo: String!, $number: Int!, $page: String) { + repositoryOwner(login: $login) { + repository(name: $repo) { + pullRequest(number: $number) { + changedFiles + additions + deletions + state + commits(first: 30, after: $page) { + totalCount + pageInfo { ... PageInfoFragment } + nodes { + commit { ... FullCommitFragment } + } + } + } + } + } } \ No newline at end of file diff --git a/data/src/main/graphql/github/repos.graphql b/data/src/main/graphql/github/repos.graphql new file mode 100644 index 00000000..e69de29b diff --git a/settings.gradle b/settings.gradle index e9016ad5..6993fed4 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,2 @@ include ':app', ':data', ':domain', ':resources', ':extensions', ':markdown', ':editor' +include ':commits'