Skip to content

Commit 2225aca

Browse files
committed
Migrate to Kotlin
1 parent 500d415 commit 2225aca

File tree

13 files changed

+49
-70
lines changed

13 files changed

+49
-70
lines changed

library/build.gradle

Lines changed: 46 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,76 @@
11
apply plugin: 'com.android.library'
2-
apply plugin: 'com.github.dcendents.android-maven' // ADD THIS
2+
apply plugin: 'kotlin-android'
3+
apply plugin: 'com.github.dcendents.android-maven'
34

4-
group='com.github.jitpack'
5+
repositories {
6+
mavenCentral()
7+
google()
8+
jcenter()
9+
maven { url "https://jitpack.io" }
10+
}
11+
12+
group = 'com.github.jitpack'
13+
version = '1.0'
514

615
android {
7-
compileSdkVersion 23
8-
buildToolsVersion "23.0.2"
16+
compileSdkVersion 28
17+
buildToolsVersion "28.0.2"
918

1019
defaultConfig {
11-
minSdkVersion 21
12-
targetSdkVersion 23
20+
minSdkVersion 16
21+
targetSdkVersion 28
1322
versionCode 1
14-
versionName "1.0"
15-
consumerProguardFiles 'proguard-rules.pro'
23+
versionName version
24+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
25+
}
26+
buildTypes {
27+
release {
28+
minifyEnabled false
29+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
30+
}
31+
}
32+
lintOptions {
33+
abortOnError false
34+
}
35+
sourceSets {
36+
main.java.srcDirs += 'src/main/kotlin'
37+
androidTest.java.srcDirs += 'src/androidTest/kotlin'
38+
androidTest.resources.srcDirs += 'src/androidTest/res'
1639
}
1740
}
1841

1942
dependencies {
20-
// add dependencies here
43+
implementation fileTree(dir: 'libs', include: ['*.jar'])
44+
45+
testImplementation 'junit:junit:4.12'
46+
androidTestImplementation 'com.android.support.test:runner:1.0.2'
47+
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
48+
49+
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
50+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
2151
}
2252

23-
// build a jar with source files
2453
task sourcesJar(type: Jar) {
25-
from android.sourceSets.main.java.srcDirs
2654
classifier = 'sources'
55+
from android.sourceSets.main.java.sourceFiles
2756
}
2857

2958
task javadoc(type: Javadoc) {
30-
failOnError false
3159
source = android.sourceSets.main.java.sourceFiles
3260
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
33-
classpath += configurations.compile
3461
}
3562

36-
// build a jar with javadoc
3763
task javadocJar(type: Jar, dependsOn: javadoc) {
3864
classifier = 'javadoc'
3965
from javadoc.destinationDir
4066
}
4167

68+
task classesJar(type: Jar) {
69+
from "$buildDir/intermediates/classes/release"
70+
}
71+
4272
artifacts {
43-
archives sourcesJar
73+
archives classesJar
4474
archives javadocJar
75+
archives sourcesJar
4576
}
46-
47-
// uncomment to build a jar file in addition to the default aar file
48-
//android.libraryVariants.all { variant ->
49-
// def name = variant.buildType.name
50-
// def task = project.tasks.create "jar${name.capitalize()}", Jar
51-
// task.dependsOn variant.javaCompile
52-
// task.from variant.javaCompile.destinationDir
53-
// artifacts.add('archives', task);
54-
//}
55-

library/proguard-rules.pro

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Add project specific ProGuard rules here.
2-
# By default, the flags in this file are appended to flags specified
3-
# in /Users/ajermakovics/Library/Android/sdk/tools/proguard/proguard-android.txt
4-
# You can edit the include path and order by changing the proguardFiles
5-
# directive in build.gradle.
6-
#
71
# For more details, see
82
# http://developer.android.com/guide/developing/tools/proguard.html
93

library/src/androidTest/java/io/jitpack/example/examplelib/ApplicationTest.java

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
<manifest package="io.jitpack.example.examplelib">
1+
<manifest package="io.jitpack.api">
2+
3+
<application />
24

35
</manifest>

library/src/main/java/ExampleLib.java

Lines changed: 0 additions & 9 deletions
This file was deleted.

library/src/main/kotlin/io/jitpack/api/JitPack.kt

Whitespace-only changes.
-9.18 KB
Binary file not shown.
-5.11 KB
Binary file not shown.
-14 KB
Binary file not shown.
-18.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)