Skip to content

Commit

Permalink
Make repository jitpack.io compatible (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehardy authored Apr 21, 2021
1 parent fac7f3d commit 0b4d550
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,24 @@ versions.
Usage
-----

Follow the guidelines from [jitpack.io](https://jitpack.io) to add the JitPack repository to your build file if you have not.

Typically, this means an edit to your `build.gradle` file to add a new `repository` definition in the `allprojects` block, like this:

```gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```

Then add the sqlite-android artifact from this repository as a dependency:

```gradle
dependencies {
implementation 'io.requery:sqlite-android:3.35.4'
implementation 'com.github.requery:sqlite-android:3.35.4'
}
```
Then change usages of `android.database.sqlite.SQLiteDatabase` to
Expand Down
28 changes: 14 additions & 14 deletions sqlite-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description = 'Android SQLite compatibility library'
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
ndkVersion '21.4.7075529'
ndkVersion '21.1.6352462'

defaultConfig {
minSdkVersion 14
Expand Down Expand Up @@ -101,19 +101,28 @@ if (localProperties.exists()) {
}

task sourceJar(type: Jar) {
classifier = 'sources'
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.compile
android.libraryVariants.all { variant ->
if (variant.name == 'release') {
owner.classpath += variant.javaCompileProvider.get().classpath
}
}
exclude '**/R.html', '**/R.*.html', '**/index.html'
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}

failOnError false
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}

Expand All @@ -129,7 +138,7 @@ publishing {
pom.withXml {
asNode().children().last() + project.pomXml
def dependencies = asNode().appendNode('dependencies')
configurations.compile.allDependencies.each {
configurations.compile.allDependencies.all {
def dependency = dependencies.appendNode('dependency')
dependency.appendNode('groupId', it.group)
dependency.appendNode('artifactId', it.name)
Expand All @@ -139,15 +148,6 @@ publishing {
}
}
}
repositories {
maven {
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
credentials {
username properties.getProperty('sonatype.username')
password properties.getProperty('sonatype.password')
}
}
}
}

publish.dependsOn "assembleRelease"

0 comments on commit 0b4d550

Please sign in to comment.