Skip to content

Commit 7259188

Browse files
committed
Initial Commit
0 parents  commit 7259188

File tree

81 files changed

+9335
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+9335
-0
lines changed

.gitattributes

Whitespace-only changes.

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# node.js
6+
#
7+
node_modules/
8+
npm-debug.log
9+
yarn-error.log
10+
11+
12+
# Android/IntelliJ
13+
#
14+
build/
15+
.idea
16+
.gradle
17+
local.properties
18+
*.iml
19+
20+
# BUCK
21+
buck-out/
22+
\.buckd/
23+
*.keystore

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
example

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# react-native-navbar-style
2+
3+
## Getting started
4+
5+
`$ npm install react-native-navbar-style --save`
6+
7+
### Mostly automatic installation
8+
9+
`$ react-native link react-native-navbar-style`
10+
11+
### Manual installation
12+
13+
14+
#### Android
15+
16+
1. Open up `android/app/src/main/java/[...]/MainApplication.java`
17+
- Add `import com.tksp.navbarstyle.RNNavbarStylePackage;` to the imports at the top of the file
18+
- Add `new RNNavbarStylePackage()` to the list returned by the `getPackages()` method
19+
2. Append the following lines to `android/settings.gradle`:
20+
```
21+
include ':react-native-navbar-style'
22+
project(':react-native-navbar-style').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navbar-style/android')
23+
```
24+
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
25+
```
26+
compile project(':react-native-navbar-style')
27+
```
28+
29+
30+
## Usage
31+
```javascript
32+
import RNNavbarStyle from 'react-native-navbar-style';
33+
34+
// TODO: What to do with the module?
35+
RNNavbarStyle;
36+
```
37+

android/.classpath

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-10/"/>
4+
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
5+
<classpathentry kind="output" path="bin/default"/>
6+
</classpath>

android/.project

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>android</name>
4+
<comment>Project android created by Buildship.</comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
22+
</natures>
23+
</projectDescription>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
connection.project.dir=
2+
eclipse.preferences.version=1

android/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
README
2+
======
3+
4+
If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm:
5+
6+
1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed
7+
2. Be sure to have a `local.properties` file in this folder that points to the Android SDK and NDK
8+
```
9+
ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle
10+
sdk.dir=/Users/{username}/Library/Android/sdk
11+
```
12+
3. Delete the `maven` folder
13+
4. Run `sudo ./gradlew installArchives`
14+
5. Verify that latest set of generated files is in the maven folder with the correct version number

android/build.gradle

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
buildscript {
2+
repositories {
3+
jcenter()
4+
google()
5+
}
6+
7+
dependencies {
8+
// Matches the RN Hello World template
9+
// https://github.com/facebook/react-native/blob/1e8f3b11027fe0a7514b4fc97d0798d3c64bc895/local-cli/templates/HelloWorld/android/build.gradle#L8
10+
classpath 'com.android.tools.build:gradle:3.1.0'
11+
}
12+
}
13+
14+
apply plugin: 'com.android.library'
15+
apply plugin: 'maven'
16+
17+
def safeExtGet(prop, fallback) {
18+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
19+
}
20+
21+
def DEFAULT_COMPILE_SDK_VERSION = 27
22+
def DEFAULT_BUILD_TOOLS_VERSION = "27.0.3"
23+
def DEFAULT_MIN_SDK_VERSION = 16
24+
def DEFAULT_TARGET_SDK_VERSION = 27
25+
26+
android {
27+
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
28+
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
29+
30+
defaultConfig {
31+
minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
32+
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
33+
versionCode 1
34+
versionName "1.0"
35+
}
36+
lintOptions {
37+
abortOnError false
38+
}
39+
}
40+
41+
repositories {
42+
maven {
43+
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
44+
// Matches the RN Hello World template
45+
// https://github.com/facebook/react-native/blob/1e8f3b11027fe0a7514b4fc97d0798d3c64bc895/local-cli/templates/HelloWorld/android/build.gradle#L21
46+
url "$projectDir/../node_modules/react-native/android"
47+
}
48+
mavenCentral()
49+
google()
50+
}
51+
52+
dependencies {
53+
compile 'com.facebook.react:react-native:+'
54+
}
55+
56+
def configureReactNativePom(def pom) {
57+
def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text)
58+
59+
pom.project {
60+
name packageJson.title
61+
artifactId packageJson.name
62+
version = packageJson.version
63+
group = "com.tksp.navbarstyle"
64+
description packageJson.description
65+
url packageJson.repository.baseUrl
66+
67+
licenses {
68+
license {
69+
name packageJson.license
70+
url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename
71+
distribution 'repo'
72+
}
73+
}
74+
75+
developers {
76+
developer {
77+
id packageJson.author.username
78+
name packageJson.author.name
79+
}
80+
}
81+
}
82+
}
83+
84+
afterEvaluate { project ->
85+
86+
task androidJavadoc(type: Javadoc) {
87+
source = android.sourceSets.main.java.srcDirs
88+
classpath += files(android.bootClasspath)
89+
classpath += files(project.getConfigurations().getByName('compile').asList())
90+
include '**/*.java'
91+
}
92+
93+
task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
94+
classifier = 'javadoc'
95+
from androidJavadoc.destinationDir
96+
}
97+
98+
task androidSourcesJar(type: Jar) {
99+
classifier = 'sources'
100+
from android.sourceSets.main.java.srcDirs
101+
include '**/*.java'
102+
}
103+
104+
android.libraryVariants.all { variant ->
105+
def name = variant.name.capitalize()
106+
task "jar${name}"(type: Jar, dependsOn: variant.javaCompile) {
107+
from variant.javaCompile.destinationDir
108+
}
109+
}
110+
111+
artifacts {
112+
archives androidSourcesJar
113+
archives androidJavadocJar
114+
}
115+
116+
task installArchives(type: Upload) {
117+
configuration = configurations.archives
118+
repositories.mavenDeployer {
119+
// Deploy to react-native-event-bridge/maven, ready to publish to npm
120+
repository url: "file://${projectDir}/../android/maven"
121+
122+
configureReactNativePom pom
123+
}
124+
}
125+
}
53.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)