Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gradle project setup and libraries. #199

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
- uses: actions/setup-java@v2
with:
java-version: 1.8
distribution: 'temurin'
java-version: '17'
java-package: jdk
- name: Build with Gradle
run: ./gradlew build
110 changes: 82 additions & 28 deletions animators/build.gradle
Original file line number Diff line number Diff line change
@@ -1,42 +1,96 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
plugins {
id('com.android.library')
id('org.jetbrains.kotlin.android')
id('org.gradle.maven-publish')
id('signing')
}

android {
compileSdkVersion COMPILE_SDK_VERSION as int
namespace 'jp.wasabeef.recyclerview'
compileSdk COMPILE_SDK_VERSION as int

defaultConfig {
minSdkVersion MIN_SDK_VERSION as int
targetSdkVersion TARGET_SDK_VERSION as int
}

publishing {
singleVariant('release') {
withSourcesJar()
withJavadocJar()
}
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "androidx.recyclerview:recyclerview:1.1.0"
kotlin {
jvmToolchain(17)
}

ext {
bintrayRepo = 'maven'
bintrayName = 'recyclerview-animators'
bintrayUserOrg = 'wasabeef'
publishedGroupId = 'jp.wasabeef'
libraryName = 'recyclerview-animators'
artifact = 'recyclerview-animators'
libraryDescription = 'Which provides simple Item animations to RecyclerView items'
siteUrl = 'https://github.com/wasabeef/recyclerview-animators'
gitUrl = 'https://github.com/wasabeef/recyclerview-animators.git'
issueUrl = 'https://github.com/wasabeef/recyclerview-animators/issues'
libraryVersion = VERSION_NAME
developerId = 'wasabeef'
developerName = 'Wasabeef'
developerEmail = 'dadadada.chop@gmail.com'
licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
}

// TODO: Close JCenter on May 1st https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/
// apply from: 'https://gist.githubusercontent.com/wasabeef/cf14805bee509baf7461974582f17d26/raw/bintray-v1.gradle'
// apply from: 'https://gist.githubusercontent.com/wasabeef/cf14805bee509baf7461974582f17d26/raw/install-v1.gradle'
def sonatypeUsername = rootProject.hasProperty('sonatypeUsername') ? rootProject.sonatypeUsername : ''
def sonatypePassword = rootProject.hasProperty('sonatypePassword') ? rootProject.sonatypePassword : ''

group = 'jp.wasabeef'
version = VERSION_NAME

afterEvaluate {
publishing {
publications {
release(MavenPublication) {
def artifact = 'recyclerview-animators'
artifactId = artifact

apply from: 'https://gist.githubusercontent.com/wasabeef/2f2ae8d97b429e7d967128125dc47854/raw/maven-central-v1.gradle'
afterEvaluate {
from components.release
}

pom {
def siteUrl = 'https://github.com/wasabeef/recyclerview-animators'
def gitUrl = 'https://github.com/wasabeef/recyclerview-animators.git'

name = artifact
description = 'Which provides simple Item animations to RecyclerView items'
url = siteUrl
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'wasabeef'
name = 'Wasabeef'
email = 'dadadada.chop@gmail.com'
}
}
scm {
connection = gitUrl
developerConnection = gitUrl
url = siteUrl
}
}
}
}

repositories {
maven {
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = "${sonatypeUsername}"
password = "${sonatypePassword}"
}
}
}
}
}

signing {
sign publishing.publications
}

This file was deleted.

2 changes: 1 addition & 1 deletion animators/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<manifest package="jp.wasabeef.recyclerview" />
<manifest />
28 changes: 4 additions & 24 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.72'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
classpath 'com.android.tools.build:gradle:4.2.0-beta04'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
tasks.withType(Javadoc) {
enabled = false
}
plugins {
id('com.android.application') version '8.2.0' apply false
id('com.android.library') version '8.2.0' apply false
id('org.jetbrains.kotlin.android') version '1.9.22' apply false
}
23 changes: 14 additions & 9 deletions example/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
plugins {
id('com.android.application')
id('org.jetbrains.kotlin.android')
}

android {
compileSdkVersion COMPILE_SDK_VERSION as int
namespace "jp.wasabeef.example.recyclerview"
compileSdk COMPILE_SDK_VERSION as int

defaultConfig {
minSdkVersion MIN_SDK_VERSION as int
Expand All @@ -21,19 +24,21 @@ android {
}
release {
debuggable false
zipAlignEnabled true
}
}

lint {
lintConfig = project.file("lint-config.xml")
}
}

repositories {
// maven { url = "https://oss.sonatype.org/content/repositories/snapshots"}
kotlin {
jvmToolchain(17)
}

dependencies {
implementation project(':animators')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "androidx.appcompat:appcompat:1.2.0"
implementation "androidx.recyclerview:recyclerview:1.1.0"
implementation "androidx.appcompat:appcompat:1.6.1"
implementation "androidx.recyclerview:recyclerview:1.3.2"
implementation 'com.squareup.picasso:picasso:2.8'
}
6 changes: 6 additions & 0 deletions example/lint-config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<lint>
<issue id="NotificationPermission">
# Only required for specific not used apis.
<ignore regexp='.*com\.squareup\.picasso.*' />
</issue>
</lint>
13 changes: 9 additions & 4 deletions example/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="jp.wasabeef.example.recyclerview"
>

<application
Expand All @@ -13,16 +12,22 @@
>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:exported="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name=".AnimatorSampleActivity" />
<activity android:name=".AdapterSampleActivity" />
<activity
android:name=".AnimatorSampleActivity"
android:exported="false"
/>
<activity
android:name=".AdapterSampleActivity"
android:exported="false"
/>

</application>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ class AdapterSampleActivity : AppCompatActivity() {

val spinner = findViewById<Spinner>(R.id.spinner)
spinner.adapter = ArrayAdapter<String>(this, android.R.layout.simple_list_item_1).apply {
for (type in Type.values()) add(type.name)
for (type in Type.entries) add(type.name)
}
spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
override fun onItemSelected(parent: AdapterView<*>, view: View, position: Int, id: Long) {
recyclerView.adapter = Type.values()[position][view.context].apply {
recyclerView.adapter = Type.entries[position][view.context].apply {
setFirstOnly(true)
setDuration(500)
setInterpolator(OvershootInterpolator(.5f))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ class AnimatorSampleActivity : AppCompatActivity() {

val spinner = findViewById<Spinner>(R.id.spinner)
val spinnerAdapter = ArrayAdapter<String>(this, android.R.layout.simple_list_item_1)
for (type in Type.values()) {
for (type in Type.entries) {
spinnerAdapter.add(type.name)
}
spinner.adapter = spinnerAdapter
spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
override fun onItemSelected(parent: AdapterView<*>, view: View, position: Int, id: Long) {
recyclerView.itemAnimator = Type.values()[position].animator
recyclerView.itemAnimator = Type.entries[position].animator
recyclerView.itemAnimator?.addDuration = 500
recyclerView.itemAnimator?.removeDuration = 500
}
Expand Down
8 changes: 3 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,24 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
org.gradle.parallel=true
org.gradle.daemon=true
org.gradle.configureondemand=true
org.gradle.caching=true
android.enableBuildCache=true
android.useAndroidX=true
android.enableJetifier=false

# Use R8 instead of ProGuard for code shrinking.
android.enableR8=true
android.enableR8.fullMode=true

VERSION_NAME=4.0.1
VERSION_CODE=401
GROUP=jp.wasabeef

COMPILE_SDK_VERSION=30
TARGET_SDK_VERSION=30
COMPILE_SDK_VERSION=34
TARGET_SDK_VERSION=34
MIN_SDK_VERSION=21
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading