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 versions and migrate to kotlin 2.0 #27

Merged
merged 6 commits into from
Nov 6, 2024
Merged
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
57 changes: 30 additions & 27 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,55 @@ on:
jobs:
lint:
name: Spotless check
runs-on: ubuntu-18.04
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
distribution: 'zulu'
java-version: 17
- name: spotless
run: ./gradlew spotlessCheck

api_check:
name: API check
runs-on: ubuntu-18.04
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
distribution: 'zulu'
java-version: 17
- name: API check
run: ./gradlew apiCheck

build:
runs-on: ubuntu-latest
runs-on: macos-latest
steps:
- uses: actions/checkout@v2

- name: set up JDK
uses: actions/setup-java@v1
with:
java-version: 11

- name: Cache Gradle and wrapper
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Make Gradle executable
run: chmod +x ./gradlew

- name: Build with Gradle
run: ./gradlew build
- uses: actions/checkout@v2

- name: set up JDK
uses: actions/setup-java@v1
with:
distribution: 'zulu'
java-version: 17

- name: Cache Gradle and wrapper
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Make Gradle executable
run: chmod +x ./gradlew

- name: Build with Gradle
run: ./gradlew build
34 changes: 0 additions & 34 deletions .github/workflows/publish-snapshot.yml

This file was deleted.

39 changes: 22 additions & 17 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,35 @@ name: Publish

on:
release:
types: [released]
types: [ released ]
workflow_dispatch:

jobs:
publish:
name: Release build and publish
runs-on: ubuntu-latest
name: Snapshot build and publish
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/[email protected]

- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: adopt
java-version: 11
distribution: 'zulu'
java-version: 17

- name: Grant Permission to Execute Gradle
run: chmod +x gradlew

- name: Release build
run: ./gradlew assemble --scan
- name: Source jar and dokka
run: ./gradlew androidSourcesJar javadocJar --scan

- name: Publish to MavenCentral
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository --scan
run: |
./gradlew publishAllPublicationsToMavenCentral --no-configuration-cache
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
63 changes: 0 additions & 63 deletions app/build.gradle

This file was deleted.

66 changes: 66 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
///*
// * Designed and developed by 2021 skydoves (Jaewoong Eum)
// *
// * Licensed under the Apache License, Version 2.0 (the "License");
// * you may not use this file except in compliance with the License.
// * You may obtain a copy of the License at
// *
// * http://www.apache.org/licenses/LICENSE-2.0
// *
// * Unless required by applicable law or agreed to in writing, software
// * distributed under the License is distributed on an "AS IS" BASIS,
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// * See the License for the specific language governing permissions and
// * limitations under the License.
// */

import com.skydoves.bindables.Configuration

plugins {
id(libs.plugins.android.application.get().pluginId)
id(libs.plugins.kotlin.android.get().pluginId)
id(libs.plugins.kotlin.parcelize.get().pluginId)
id(libs.plugins.kotlin.kapt.get().pluginId)
id(libs.plugins.ksp.get().pluginId)
id(libs.plugins.hilt.plugin.get().pluginId)
}

android {
namespace = "com.skydoves.bindablesdemo"
compileSdk = Configuration.compileSdk
defaultConfig {
applicationId = "com.skydoves.bindablesdemo"
minSdk = Configuration.minSdk
targetSdk = Configuration.targetSdk
versionCode = Configuration.versionCode
versionName = Configuration.versionName
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = "11"
}

buildFeatures {
dataBinding = true
}
}

dependencies {
implementation(project(":bindables"))

implementation(libs.hilt.android)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.activity)
implementation(libs.androidx.constraintlayout)
ksp(libs.hilt.compiler)

implementation(libs.androidx.material)
implementation(libs.androidx.fragment)
implementation(libs.glide)
implementation(libs.whatif)
}
9 changes: 4 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.skydoves.bindablesdemo">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />

<application
android:name=".BindableApp"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.BindablesDemo">

<activity
android:name=".MainActivity"
android:theme="@style/AppTheme"
android:exported="true">
android:exported="true"
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ class MainActivity : BindingActivity<ActivityMainBinding>(R.layout.activity_main
override fun onPageScrolled(
position: Int,
positionOffset: Float,
positionOffsetPixels: Int
positionOffsetPixels: Int,
) = Unit

override fun onPageSelected(position: Int) {
binding.mainBottomNavigation.menu.getItem(position).isChecked = true
}
}
},
)
}

binding.mainBottomNavigation.setOnNavigationItemSelectedListener {
binding.mainBottomNavigation.setOnItemSelectedListener {
when (it.itemId) {
R.id.action_one -> binding.mainViewpager.currentItem = 0
R.id.action_two -> binding.mainViewpager.currentItem = 1
Expand Down
Loading
Loading