Skip to content

Commit

Permalink
add script for publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
onebone committed May 1, 2021
1 parent aca612d commit 8ca4301
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ captures/
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml

.idea/deploymentTargetDropDown.xml

# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
Expand Down Expand Up @@ -207,6 +209,8 @@ crashlytics.properties
crashlytics-build.properties
fabric.properties

/publish.properties

### AndroidStudio Patch ###

!/gradle/wrapper/gradle-wrapper.jar
Expand Down
6 changes: 6 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/src/main/java/me/onebone/toolbar/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ fun MainScreen() {

Image(
modifier = Modifier
.parallax()
.pin()
.padding(16.dp),
painter = painterResource(id = R.drawable.abc_vector_test),
contentDescription = null
Expand Down
74 changes: 74 additions & 0 deletions gradle/publish.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
apply plugin: 'maven-publish'
apply plugin: 'signing'

ext['signing.keyId'] = ''
ext['signing.password'] = ''
ext['signing.secretKeyRingFile'] = ''

var properties = new Properties()
var file = project.rootProject.file('publish.properties')
if(file.exists()) {
properties.load(new FileInputStream(file))

ext['signing.keyId'] = properties.getProperty('signing.keyId')
ext['signing.password'] = properties.getProperty('signing.password')
ext['signing.secretKeyRingFile'] = properties.getProperty('signing.secretKeyRingFile')

ext.ossrhUsername = properties.getProperty('ossrhUsername')
ext.ossrhPassword = properties.getProperty('ossrhPassword')
}

publishing {
publications {
release(MavenPublication) {
groupId = 'me.onebone'
artifactId = 'toolbar-compose'
version = android.defaultConfig.versionName

pom {
name = 'Collapsing Toolbar'
description = 'A simple implementation of collapsing toolbar for Jetpack Compose'
url = 'https://github.com/onebone/compose-collapsing-toolbar'

licenses {
license {
name = 'MIT License'
url = 'https://raw.githubusercontent.com/onebone/compose-collapsing-toolbar/master/LICENSE'
}
}

developers {
developer {
id = 'onebone'
name = 'onebone'
email = '[email protected]'
}
}

scm {
connection = 'scm:git:git://github.com/onebone/compose-collapsing-toolbar.git'
developerConnection = 'scm:git:ssh://github.com/onebone/compose-collapsing-toolbar.git'
url = 'https://github.com/onebone/compose-collapsing-toolbar'
}
}
}
}

repositories {
maven {
name = 'mavenCentral'
url = version.endsWith('SNAPSHOT') ?
'https://s01.oss.sonatype.org/content/repositories/snapshots/' :
'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'

credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}

signing {
sign publishing.publications
}
2 changes: 2 additions & 0 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ dependencies {
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
}

apply from: rootProject.file('gradle/publish.gradle')

1 comment on commit 8ca4301

@JayP198636
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UnsecureDashbosr
00.000,01$

Please sign in to comment.