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 project and libs #5

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
30 changes: 20 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply from: "$rootDir/gradle/local-aar.gradle"

android {
compileSdkVersion 28
namespace "com.sample.localaar.demo"

compileSdk 33
defaultConfig {
applicationId "com.sample.localaar.demo"
minSdkVersion 16
targetSdkVersion 28
minSdkVersion 21
targetSdkVersion 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -19,18 +20,27 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

buildFeatures {
viewBinding = true
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation customModulePath(':myawesomemodule1')
implementation customModulePath(':myawesomemodule2')
implementation customModulePath(':myawesomemodule3')
Expand Down
5 changes: 2 additions & 3 deletions app/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 xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sample.localaar.demo">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
Expand All @@ -9,7 +8,7 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity android:name=".MainActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
14 changes: 9 additions & 5 deletions app/src/main/java/com/sample/localaar/demo/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@ package com.sample.localaar.demo

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.sample.localaar.demo.databinding.ActivityMainBinding
import com.sample.localaar.myawesomemodule1.AwesomeModule1
import com.sample.localaar.myawesomemodule2.AwesomeModule2
import com.sample.localaar.myawesomemodule3.AwesomeModule3
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {

lateinit var binding: ActivityMainBinding

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
textView2.text= AwesomeModule1.greet
textView3.text= AwesomeModule2.greet
textView4.text= AwesomeModule3.greet
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)

binding.textView2.text = AwesomeModule1.greet
binding.textView3.text = AwesomeModule2.greet
binding.textView4.text = AwesomeModule3.greet
}
}
9 changes: 4 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ apply from: "$rootDir/gradle/local-aar-config.gradle"
apply from: "$rootDir/gradle/local-aar.gradle"

buildscript {
ext.kotlin_version = '1.3.31'
ext.kotlin_version = '1.8.10'
repositories {
google()
jcenter()

mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.android.tools.build:gradle:7.3.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -23,7 +22,7 @@ allprojects {
url = "$rootDir/localMavenRepository"
}
google()
jcenter()
mavenCentral()
}
}

Expand Down
11 changes: 7 additions & 4 deletions gradle/library.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ apply from: "$rootDir/gradle/publish.gradle"


android {
compileSdkVersion 28

compileSdkVersion 33
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
minSdkVersion 21
targetSdkVersion 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -21,6 +20,10 @@ android {
}
}

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

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion gradle/local-aar.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ configurations.all {
resolutionStrategy.dependencySubstitution {
if (useAARForDevBuild) {
inDevModules.each { moduleName ->
substitute module("${localAARPublishConfig.groupId}$moduleName:${localAARPublishConfig.version}") with project(moduleName)
substitute module("${localAARPublishConfig.groupId}$moduleName:${localAARPublishConfig.version}") using project(moduleName)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip