Skip to content

Commit 2918a7d

Browse files
Support incremental annotation processing and more:
* Switch from Support annotations library to `androidx.annotation` * Java 8 is now required * Minimum SDK increased from `9` to `14` (app shortcuts are still not available before `25`) * Update: Android Gradle plugin to `3.6.4` * Some small changes to bring everything to 2020
1 parent a3f99c9 commit 2918a7d

28 files changed

+265
-264
lines changed

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Change Log
2+
==========
3+
4+
Version 1.1.0 *(2020-07-21)*
5+
-----------------------------
6+
* New: Support for incremental annotation processing
7+
* Switch from Support annotations library to `androidx.annotation`
8+
* Java 8 is now required
9+
* Minimum SDK increased from `9` to `14` (app shortcuts are still not available before `25`)
10+
* Update: Android Gradle plugin to `3.6.4`
11+
* Some small changes to bring everything to 2020
12+
13+
14+
Version 1.0.2 *(2017-09-24)*
15+
-----------------------------
16+
* Fix: Annotated methods are called before `onCreate()` (#13)
17+
* Update: Support annotations library to `26.0.2`. This requires the new Google Maven Repository:
18+
19+
```groovy
20+
google()
21+
```
22+
or
23+
```groovy
24+
maven {
25+
url "https://maven.google.com"
26+
}
27+
```
28+
29+
30+
Version 1.0.1 *(2017-03-04)*
31+
-----------------------------
32+
33+
* Fix: `Shortbread.create(context)` can now also be called if there are no `@Shortcut` annotations in the code, which before produced a crash. Previously created shortcuts are now removed.
34+
* Fix: Internal `NullPointerException` when an activity containing method shortcuts is not launched via a method shortcut
35+
* Add Javadoc for the public API
36+
37+
38+
Version 10.2.0 *(2017-02-11)*
39+
-----------------------------
40+
41+
Initial release

README.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Shortbread
22
==========
33

4-
Android library that generates [app shortcuts][1] for activities and methods annotated with `@Shortcut`.
5-
No need to touch the manifest, create XML files or use the shortcut manager. Just annotate the code that
4+
Android library that generates [app shortcuts][1] for activities and methods annotated with `@Shortcut`.
5+
No need to touch the manifest, create XML files or use the shortcut manager. Just annotate the code that
66
you want the shortcut to call.
77

88
![Sample](sample.png)
@@ -14,10 +14,10 @@ The four shortcuts above are produced by the following code:
1414
public class MoviesActivity extends Activity {
1515

1616
// ...
17-
17+
1818
@Shortcut(id = "add_movie", icon = R.drawable.ic_shortcut_add, shortLabel = "Add movie")
1919
public void addMovie() {
20-
// code to add movie, could show an AddMovieDialogFragment for example
20+
// code to add movie, could show an AddMovieDialogFragment for example
2121
}
2222
}
2323
```
@@ -27,16 +27,16 @@ public class MoviesActivity extends Activity {
2727
public class BooksActivity extends Activity {
2828

2929
// ...
30-
30+
3131
@Shortcut(id = "favorite_books", icon = R.drawable.ic_shortcut_favorite, shortLabel = "Favorite books")
3232
public void showFavoriteBooks() {
33-
// code to display favorite books, could show a FavoriteBooksFragment for example
33+
// code to display favorite books, could show a FavoriteBooksFragment for example
3434
}
3535
}
3636
```
3737

38-
To display the shortcuts, call `Shortbread.create(Context context)` as early as possible in the app, for
39-
example in `onCreate` of a custom `Application`.
38+
To display the shortcuts, call `Shortbread.create(Context context)` as early as possible in the app, for
39+
example in `onCreate` of a custom `Application`.
4040

4141
```java
4242
public class App extends Application {
@@ -51,11 +51,11 @@ public class App extends Application {
5151
```
5252

5353
Shortcuts can be customized with attributes, just like using the framework API.
54-
54+
5555
```java
5656
@Shortcut(
57-
id = "books",
58-
icon = R.drawable.ic_shortcut_books,
57+
id = "books",
58+
icon = R.drawable.ic_shortcut_books,
5959
shortLabel = "Books",
6060
shortLabelRes = R.string.shortcut_books_short_label,
6161
longLabel = "List of books",
@@ -73,10 +73,23 @@ public class BooksActivity extends Activity { /*...*/ }
7373
Download
7474
--------
7575

76+
### Java
77+
7678
```groovy
7779
dependencies {
78-
compile 'com.github.matthiasrobbers:shortbread:1.0.2'
79-
annotationProcessor 'com.github.matthiasrobbers:shortbread-compiler:1.0.2'
80+
implementation 'com.github.matthiasrobbers:shortbread:1.1.0'
81+
annotationProcessor 'com.github.matthiasrobbers:shortbread-compiler:1.1.0'
82+
}
83+
```
84+
85+
### Kotlin
86+
87+
```groovy
88+
apply plugin: 'kotlin-kapt'
89+
90+
dependencies {
91+
implementation 'com.github.matthiasrobbers:shortbread:1.1.0'
92+
kapt 'com.github.matthiasrobbers:shortbread-compiler:1.1.0'
8093
}
8194
```
8295

bintray.gradle

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

build.gradle

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,29 @@
11
buildscript {
22
repositories {
33
jcenter()
4+
google()
45
}
56
dependencies {
6-
classpath 'com.android.tools.build:gradle:2.3.3'
7-
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
8-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
7+
classpath 'com.android.tools.build:gradle:3.6.4'
8+
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.12.0'
9+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
910
}
1011
}
1112

12-
allprojects {
13+
subprojects {
1314
repositories {
1415
jcenter()
15-
maven {
16-
url "https://maven.google.com"
17-
}
16+
google()
1817
}
1918
}
2019

21-
task clean(type: Delete) {
22-
delete rootProject.buildDir
23-
}
24-
2520
ext {
26-
compileSdkVersion = 26
27-
buildToolsVersion = '26.0.1'
28-
minSdkVersion = 9
29-
targetSdkVersion = 26
30-
sourceCompatibilityVersion = '1.7'
31-
targetCompatibilityVersion = '1.7'
32-
supportLibraryVersion = '26.0.2'
33-
34-
githubUrl = 'https://github.com/matthiasrobbers/shortbread'
35-
gitUrl = 'https://github.com/matthiasrobbers/shortbread.git'
36-
libraryVersion = '1.0.2'
21+
compileSdkVersion = 29
22+
buildToolsVersion = '29.0.3'
23+
minSdkVersion = 14
24+
sourceCompatibilityVersion = JavaVersion.VERSION_1_8
25+
targetCompatibilityVersion = JavaVersion.VERSION_1_8
26+
androidxAnnotationVersion = '1.1.0'
27+
autoServiceVersion = '1.0-rc7'
28+
incapVersion = '0.3'
3729
}

gradle.properties

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
# Project-wide Gradle settings.
1+
org.gradle.jvmargs=-Xmx1536m
2+
android.useAndroidX=true
23

3-
# IDE (e.g. Android Studio) users:
4-
# Gradle settings configured through the IDE *will override*
5-
# any settings specified in this file.
4+
GROUP=com.github.matthiasrobbers
5+
VERSION_NAME=1.1.0
66

7-
# For more details on how to configure your build environment visit
8-
# http://www.gradle.org/docs/current/userguide/build_environment.html
7+
POM_URL=https://github.com/matthiasrobbers/shortbread
8+
POM_SCM_URL=https://github.com/matthiasrobbers/shortbread
9+
POM_SCM_CONNECTION=scm:git:git://github.com/matthiasrobbers/shortbread.git
10+
POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/matthiasrobbers/shortbread.git
911

10-
# Specifies the JVM arguments used for the daemon process.
11-
# The setting is particularly useful for tweaking memory settings.
12-
org.gradle.jvmargs=-Xmx1536m
12+
POM_LICENCE_NAME=The Apache Software License, Version 2.0
13+
POM_LICENCE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt
14+
POM_LICENCE_DIST=repo
15+
16+
POM_DEVELOPER_ID=matthiasrobbers
17+
POM_DEVELOPER_NAME=Matthias Robbers
18+
POM_DEVELOPER_URL=https://github.com/matthiasrobbers/
1319

14-
# When configured, Gradle will run in incubating parallel mode.
15-
# This option should only be used with decoupled projects. More details, visit
16-
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17-
# org.gradle.parallel=true
20+
RELEASE_SIGNING_ENABLED=false
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed Mar 15 15:30:47 GMT 2017
1+
#Tue Jun 30 22:07:02 CEST 2020
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

install.gradle

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

publish.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apply plugin: "com.vanniktech.maven.publish"
2+
3+
mavenPublish {
4+
targets {
5+
uploadArchives {
6+
releaseRepositoryUrl = "https://api.bintray.com/content/matthiasrobbers/maven/" +
7+
"${project.findProperty("POM_ARTIFACT_ID")}/${project.findProperty("VERSION_NAME")}/"
8+
repositoryUsername = System.getenv("BINTRAY_USER")
9+
repositoryPassword = System.getenv("BINTRAY_KEY")
10+
}
11+
}
12+
}

sample/build.gradle

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion rootProject.ext.compileSdkVersion
5-
buildToolsVersion rootProject.ext.buildToolsVersion
4+
compileSdkVersion project.compileSdkVersion
5+
buildToolsVersion project.buildToolsVersion
66

77
defaultConfig {
88
applicationId "com.example.shortbread"
9-
minSdkVersion rootProject.ext.minSdkVersion
10-
targetSdkVersion rootProject.ext.targetSdkVersion
9+
minSdkVersion project.minSdkVersion
10+
targetSdkVersion 29
1111
versionCode 1
1212
versionName "1.0"
1313
}
1414

15+
compileOptions {
16+
sourceCompatibility = sourceCompatibilityVersion
17+
targetCompatibility = targetCompatibilityVersion
18+
}
19+
1520
buildTypes {
1621
debug {
1722
minifyEnabled false
@@ -20,6 +25,6 @@ android {
2025
}
2126

2227
dependencies {
23-
compile project(':shortbread')
28+
implementation project(':shortbread')
2429
annotationProcessor project(':shortbread-compiler')
2530
}

sample/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
android:allowBackup="true"
88
android:icon="@mipmap/ic_launcher"
99
android:label="@string/app_name"
10-
android:supportsRtl="true"
11-
android:theme="@style/android:Theme.Material.Light.DarkActionBar">
10+
android:supportsRtl="true">
1211

1312
<activity
1413
android:name="com.example.shortbread.MainActivity">

0 commit comments

Comments
 (0)