Skip to content

Commit 18c416d

Browse files
committed
Gradle Cleanup lightbasenl#77
1 parent 953c8f8 commit 18c416d

File tree

3 files changed

+18
-114
lines changed

3 files changed

+18
-114
lines changed

android/build.gradle

Lines changed: 11 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,27 @@
1-
buildscript {
2-
repositories {
3-
google()
4-
jcenter()
5-
}
6-
7-
dependencies {
8-
// Matches recent template from React Native (0.59)
9-
// https://github.com/facebook/react-native/blob/0.59-stable/template/android/build.gradle#L16
10-
classpath 'com.android.tools.build:gradle:3.3.2'
11-
}
12-
}
13-
14-
apply plugin: 'com.android.library'
15-
apply plugin: 'maven'
1+
def DEFAULT_COMPILE_SDK_VERSION = 29
2+
def DEFAULT_TARGET_SDK_VERSION = 29
163

174
def safeExtGet(prop, fallback) {
185
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
196
}
207

21-
// Matches values in recent template from React Native (0.59)
22-
// https://github.com/facebook/react-native/blob/0.59-stable/template/android/build.gradle#L5-L9
23-
def DEFAULT_COMPILE_SDK_VERSION = 28
24-
def DEFAULT_BUILD_TOOLS_VERSION = "28.0.3"
25-
def DEFAULT_MIN_SDK_VERSION = 19
26-
def DEFAULT_TARGET_SDK_VERSION = 28
8+
apply plugin: 'com.android.library'
279

2810
android {
2911
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
30-
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
3112

3213
defaultConfig {
33-
minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
34-
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
35-
versionCode 1
36-
versionName "1.0"
37-
}
38-
lintOptions {
39-
abortOnError false
14+
minSdkVersion safeExtGet('minSdkVersion', 16)
15+
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
16+
versionCode 1
17+
versionName "1.0"
4018
}
4119
}
4220

43-
repositories {
44-
maven {
45-
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
46-
// Matches recent template from React Native (0.59)
47-
// https://github.com/facebook/react-native/blob/0.59-stable/template/android/build.gradle#L30
48-
url "$projectDir/../node_modules/react-native/android"
49-
}
21+
repositories{
5022
mavenCentral()
23+
google()
24+
jcenter()
5125
}
5226

5327
dependencies {
@@ -59,77 +33,4 @@ dependencies {
5933
implementation 'com.google.vr:sdk-commonwidget:1.180.0'
6034
implementation 'com.google.vr:sdk-panowidget:1.180.0'
6135
implementation 'commons-io:commons-io:2.5'
62-
}
63-
64-
def configureReactNativePom(def pom) {
65-
def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text)
66-
67-
pom.project {
68-
name packageJson.title
69-
artifactId packageJson.name
70-
version = packageJson.version
71-
group = "nl.lightbase"
72-
description packageJson.description
73-
url packageJson.repository.baseUrl
74-
75-
licenses {
76-
license {
77-
name packageJson.license
78-
url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename
79-
distribution 'repo'
80-
}
81-
}
82-
83-
developers {
84-
developer {
85-
id packageJson.author.username
86-
name packageJson.author.name
87-
}
88-
}
89-
}
90-
}
91-
92-
afterEvaluate { project ->
93-
// some Gradle build hooks ref:
94-
// https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html
95-
task androidJavadoc(type: Javadoc) {
96-
source = android.sourceSets.main.java.srcDirs
97-
classpath += files(android.bootClasspath)
98-
classpath += files(project.getConfigurations().getByName('compile').asList())
99-
include '**/*.java'
100-
}
101-
102-
task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
103-
classifier = 'javadoc'
104-
from androidJavadoc.destinationDir
105-
}
106-
107-
task androidSourcesJar(type: Jar) {
108-
classifier = 'sources'
109-
from android.sourceSets.main.java.srcDirs
110-
include '**/*.java'
111-
}
112-
113-
android.libraryVariants.all { variant ->
114-
def name = variant.name.capitalize()
115-
def javaCompileTask = variant.javaCompileProvider.get()
116-
117-
task "jar${name}"(type: Jar, dependsOn: javaCompileTask) {
118-
from javaCompileTask.destinationDir
119-
}
120-
}
121-
122-
artifacts {
123-
archives androidSourcesJar
124-
archives androidJavadocJar
125-
}
126-
127-
task installArchives(type: Upload) {
128-
configuration = configurations.archives
129-
repositories.mavenDeployer {
130-
// Deploy to react-native-event-bridge/maven, ready to publish to npm
131-
repository url: "file://${projectDir}/../android/maven"
132-
configureReactNativePom pom
133-
}
134-
}
135-
}
36+
}

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
2-
"name": "@lightbase/react-native-panorama-view",
2+
"name": "@antonhudz/react-native-panorama-view",
3+
"publishConfig": {
4+
"access": "public"
5+
},
36
"title": "React Native Panorama View",
47
"version": "1.0.1",
58
"description": "A simple component for displaying panoramic images in your React Native app.",
@@ -12,8 +15,8 @@
1215
},
1316
"repository": {
1417
"type": "git",
15-
"url": "git+https://github.com/lightbasenl/react-native-panorama-view.git",
16-
"baseUrl": "https://github.com/lightbasenl/react-native-panorama-view"
18+
"url": "git+https://github.com/antonhudz/react-native-panorama-view.git",
19+
"baseUrl": "https://github.com/antonhudz/react-native-panorama-view"
1720
},
1821
"keywords": [
1922
"react-native"

react-native-panorama-view.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
1111
s.authors = package["author"]
1212
s.platform = :ios, "10.0"
1313

14-
s.source = { :git => "https://github.com/lightbasenl/react-native-panorama-view.git", :tag => "#{s.version}" }
14+
s.source = { :git => "https://github.com/antonhudz/react-native-panorama-view.git", :tag => "#{s.version}" }
1515
s.source_files = "ios/**/*.{h,m,swift}"
1616

1717
s.swift_version = '5.3'

0 commit comments

Comments
 (0)