Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
li-advait committed Nov 12, 2024
1 parent a514829 commit 54db3fe
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 26 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.4.1'
classpath 'com.android.tools.build:gradle:8.7.2'
}
}

Expand All @@ -24,8 +24,8 @@ subprojects {
}

ext {
compileSdkVersion = 31
buildToolsVersion = '31.0.0'
compileSdkVersion = 35
buildToolsVersion = '35.0.0'
minSdkVersion = 21
targetSdkVersion = 30
targetSdkVersion = 35
}
27 changes: 16 additions & 11 deletions gradle/publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,38 @@ apply plugin: 'signing'
// Ideally AGP should provide sources and javadoc integration for their components:
// https://issuetracker.google.com/issues/145670440
tasks.register("sourcesJar", Jar) {
classifier 'sources'
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}

tasks.register("javadoc", Javadoc) {
tasks.register('androidJavadocs', Javadoc) {
failOnError false
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
android.libraryVariants.all { variant ->
if (variant.name == 'release') {
owner.classpath += variant.javaCompileProvider.get().classpath
}
}
exclude '**/R.html', '**/R.*.html', '**/index.html'
}

tasks.register("javadocJar", Jar) {
dependsOn javadoc
classifier 'javadoc'
from javadoc.destinationDir
tasks.register('androidJavadocsJar', Jar) {
dependsOn androidJavadocs
archiveClassifier.set('javadoc')
from androidJavadocs.destinationDir
}

// AGP creates the components in afterEvaluate, so we need to use it too
// https://developer.android.com/studio/build/maven-publish-plugin
afterEvaluate {
publishing {
publications {
maven(MavenPublication) {
from components.release

maven(MavenPublication){
from(components["release"])
// Adds javadocs and sources as separate jars.
artifact sourcesJar
artifact javadocJar

artifact androidJavadocsJar
pom {
name = 'Shaky'
description = 'Shake-to-send-feedback library for Android'
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 1 addition & 0 deletions shaky-sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apply plugin: 'com.android.application'

android {
namespace "com.linkedin.android.shaky.app"
compileSdkVersion rootProject.ext.compileSdkVersion

compileOptions {
Expand Down
6 changes: 3 additions & 3 deletions shaky-sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.linkedin.android.shaky.app"
xmlns:android="http://schemas.android.com/apk/res/android"
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<!-- for MultipleAttachmentShakeDelegate example -->
<uses-permission android:name="android.permission.READ_LOGS"
Expand All @@ -16,7 +15,8 @@

<activity
android:name=".ShakyDemo"
android:label="@string/app_name">
android:label="@string/app_name"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

Expand Down
12 changes: 7 additions & 5 deletions shaky/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apply plugin: 'com.android.library'
apply from: "$rootDir/gradle/publishing.gradle"

android {
namespace "com.linkedin.android.shaky"
compileSdkVersion rootProject.ext.compileSdkVersion

compileOptions {
Expand All @@ -16,10 +17,11 @@ android {
versionName "1.0"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
publishing {
singleVariant("release") {
// if you don't want sources/javadoc, remove these lines
withSourcesJar()
withJavadocJar()
}
}

Expand All @@ -41,5 +43,5 @@ dependencies {

testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:3.12.4'
testImplementation 'org.robolectric:robolectric:4.9.2'
testImplementation 'org.robolectric:robolectric:4.14-beta-1'
}
3 changes: 1 addition & 2 deletions shaky/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest package="com.linkedin.android.shaky"
xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application android:supportsRtl="true">
<activity android:name="com.linkedin.android.shaky.FeedbackActivity" />
Expand Down

0 comments on commit 54db3fe

Please sign in to comment.