Replaced grunt with gradle

This commit is contained in:
Hristo Hristov
2015-12-16 15:30:19 +02:00
parent 48310a31b8
commit 275b4306cd
8 changed files with 39 additions and 54 deletions

3
.gitignore vendored
View File

@@ -6,4 +6,5 @@
.DS_Store
/build
/captures
/node_modules
/node_modules
/dist

2
.idea/.name generated
View File

@@ -1 +1 @@
android-widgets-app
android-widgets

27
.idea/misc.xml generated
View File

@@ -1,32 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />

6
.idea/vcs.xml generated
View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@@ -3,16 +3,8 @@ Contains the source code of the `org.nativescript.widgets` library used by the N
## How to Build
```
gradle build
gradle packFramework
```
This generates widgets-debug.aar and widgets-release.aar files located in the widgets/build/outputs/aar folder.
## How to Make NPM Package
Requires nodejs, npm, gradle and grunt.
```
npm install
grunt
```
This generates tgz files in build folder.
And generates tgz files in dist folder.

View File

@@ -20,4 +20,4 @@ allprojects {
task clean(type: Delete) {
delete rootProject.buildDir
}
}

View File

@@ -15,12 +15,5 @@
"bugs": {
"url": "https://github.com/NativeScript/android-widgets/issues"
},
"homepage": "https://github.com/NativeScript/android-widgets#readme",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-copy": "^0.8.0",
"grunt-exec": "^0.4.6",
"grunt-mkdir": "^0.1.2"
}
"homepage": "https://github.com/NativeScript/android-widgets#readme"
}

View File

@@ -1,3 +1,5 @@
def isWinOs = System.properties['os.name'].toLowerCase().contains('windows')
apply plugin: 'com.android.library'
android {
@@ -23,3 +25,33 @@ dependencies {
testCompile 'junit:junit:4.12'
compile 'com.android.support:support-v4:+'
}
task cleanDistDir (type: Delete) {
delete "../dist/"
}
task copyAar << {
copy {
from "../package.json"
into "../dist"
}
copy {
from "build/outputs/aar/widgets-release.aar"
into "../dist/platforms/android/"
}
}
task packFramework (type: Exec) {
workingDir "../dist"
if(isWinOs) {
commandLine "cmd", "/c", "npm", "pack"
}
else {
commandLine "npm", "pack"
}
}
assembleRelease.dependsOn(cleanDistDir)
copyAar.dependsOn(assembleRelease)
packFramework.dependsOn(copyAar)