I try to develop a plugin for a sample NativeScript app (created with:
tns create MyTnsApp --tsc
I created a plugin for it with nativescript-plugin-seed (directory tree seen below).
I put a console.log('Hello World!') to the plugin and I called if from the main app. It works when I run it.
While the application is running and I change something in the plugin the cli detects it and it starts an incremental compilation. However, when I terminate running and run the app again the changes are not visible.
I have to remove the plugin with tns, and add it again.
Is there a way to improve this process without removing/readding the plugin?
Regards,
roncsak
├── app
│ ├── App_Resources
│ ├── LICENSE
│ ├── README.md
│ ├── app.css
│ ├── app.js
│ ├── app.ts
│ ├── bundle-config.js
│ ├── bundle-config.ts
│ ├── main-page.js
│ ├── main-page.ts
│ ├── main-page.xml
│ ├── main-view-model.js
│ ├── main-view-model.ts
│ └── package.json
├── hooks
│ └── ...
├── node_modules
│ └── ...
├── package.json
├── platforms
│ └── ios
├── plugins
│ └── nativescript-myplugin
│ └── src
│ ├── index.js
│ ├── index.ts
│ ├── myplugin.js
│ ├── myplugin.ts
│ ├── package.json
│ ├── platforms
│ │ └── ios
│ └── tsconfig.json
│
└── tsconfig.json
./package.json
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "org.nativescript.MyTnsApp",
"tns-ios": {
"version": "3.4.1"
}
},
"dependencies": {
"nativescript-myplugin": "file:plugins/nativescript-myplugin/src",
"nativescript-theme-core": "~1.0.4",
"tns-core-modules": "~3.4.0"
},
"devDependencies": {
"nativescript-dev-typescript": "~0.6.0",
"typescript": "~2.4.2"
}
}
./plugins/nativescript-myplugin/src/package.json
{
"name": "nativescript-myplugin",
"version": "0.0.1",
"description": "Your awesome NativeScript plugin.",
"main": "index.js",
"nativescript": {
"platforms": {
"ios": "3.4.1"
}
},
"devDependencies": {
"tns-core-modules": "~3.4.0",
"tns-platform-declarations": "^3.4.1"
}
}
Related
I'm trying to customise the look of the DRF tutorial API by following this - https://www.django-rest-framework.org/topics/browsable-api/?q=base.html#the-browsable-api.
If I use a web address in the api.html href here, it works:
{% extends "rest_framework/base.html" %}
{% block bootstrap_theme %}
<link rel="stylesheet" href="https://bootswatch.com/5/vapor/bootstrap.min.css" type="text/css">
{% endblock %}
If I download bootstrap.min.css, where should I put it, and what should the href path be?
Wherever I try at the moment, I get a Not Found: error in the server logs.
Here's my TEMPLATES dictionary from settings.py:
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'snippets', 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
And my directory structure:
.
└── pastebin
├── db.sqlite3
├── manage.py
├── pastebin
│ ├── __init__.py
│ ├── __pycache__
│ ├── asgi.py
│ ├── pathtest.py
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
└── snippets
├── __init__.py
├── __pycache__
├── admin.py
├── apps.py
├── migrations
│ ├── 0001_initial.py
│ ├── 0002_snippet_highlighted.py
│ ├── __init__.py
│ └── __pycache__
├── models.py
├── serializers.py
├── templates
│ └── rest_framework
│ └── api.html
├── tests.py
├── urls.py
└── views.py
Thank you
I appear to have found a way. I'd be interested to know if this is the correct way.
I added a static directory with the downloaded css file in it:
.
└── pastebin
├── db.sqlite3
├── manage.py
├── pastebin
│ ├── __init__.py
│ ├── __pycache__
│ ├── asgi.py
│ ├── pathtest.py
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
├── snippets
│ ├── __init__.py
│ ├── __pycache__
│ ├── admin.py
│ ├── apps.py
│ ├── migrations
│ │ ├── 0001_initial.py
│ │ ├── 0002_snippet_highlighted.py
│ │ ├── __init__.py
│ │ └── __pycache__
│ ├── models.py
│ ├── serializers.py
│ ├── templates
│ │ └── rest_framework
│ │ └── api.html
│ ├── tests.py
│ ├── urls.py
│ └── views.py
└── static
└── bootstrap.css
I updated the settings.py file with this:
STATICFILES_DIRS = [
BASE_DIR / "static",
]
And the href in api.html like so:
{% extends "rest_framework/base.html" %}
{% block bootstrap_theme %}
<link rel="stylesheet" href="/static/bootstrap.css" type="text/css">
{% endblock %}
According to the docs here, when running the development server with python3 manage.py runserver the serving of this static file is being handled automatically.
I'm trying to run apache atlas on my local. There are several problem I have faced to.
First, for clearance of how I have build the apache atlas I will describe the steps:
git clone https://github.com/apache/atlas
cd atlas
mvn clean install -DskipTests -X
mvn clean package -Pdist -DskipTests
It has been built without any error. Here is the project structure:
.
├── 3party-licenses
│ ├── Antlr-LICENSE
│ ├── Respond-LICENSE
│ ├── animate-LICENSE
│ ├── backgrid-columnmanager-LICENSE
│ ├── bootstrap-daterangepicker-LICENSE
│ ├── bootstrap-sidebar-LICENSE
│ ├── es5-shim-LICENSE
│ ├── google-fonts-LICENSE
│ ├── handlebars-LICENSE
│ ├── hbs-LICENSE
│ ├── jQuery-QueryBuilder-LICENSE
│ ├── jQuery-ui-LICENSE
│ ├── janusgraph-LICENSE
│ ├── jquery-placeholder-LICENSE
│ ├── mock-LICENSE
│ ├── normalize.css-LICENSE
│ ├── platform-LICENSE
│ ├── pnotify-LICENSE
│ ├── require-handlebars-plugin-LICENSE
│ ├── swagger-ui-LECENSE
│ └── titan-LICENSE
├── DISCLAIMER.txt
├── LICENSE
├── NOTICE
├── README.txt
├── addons
│ ├── falcon-bridge
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ ├── falcon-bridge-shim
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ ├── hbase-bridge
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ ├── hbase-bridge-shim
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ ├── hbase-testing-util
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ ├── hdfs-model
│ │ ├── pom.xml
│ │ └── target
│ ├── hive-bridge
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ ├── hive-bridge-shim
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ ├── impala-bridge
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ ├── impala-bridge-shim
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ ├── impala-hook-api
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ ├── kafka-bridge
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ ├── models
│ │ ├── 0000-Area0
│ │ ├── 1000-Hadoop
│ │ ├── 2000-RDBMS
│ │ ├── 3000-Cloud
│ │ └── 4000-MachineLearning
│ ├── sqoop-bridge
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ ├── sqoop-bridge-shim
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ ├── storm-bridge
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ └── storm-bridge-shim
│ ├── pom.xml
│ ├── src
│ └── target
├── atlas-examples
│ ├── pom.xml
│ ├── sample-app
│ │ ├── README.md
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ └── target
│ ├── maven-shared-archive-resources
│ └── rat.txt
├── authorization
│ ├── pom.xml
│ ├── src
│ │ ├── main
│ │ └── test
│ └── target
│ ├── atlas-authorization-3.0.0-SNAPSHOT.jar
│ ├── classes
│ ├── generated-sources
│ ├── generated-test-sources
│ ├── maven-archiver
│ ├── maven-shared-archive-resources
│ ├── maven-status
│ ├── rat.txt
│ └── test-classes
├── build-tools
│ ├── pom.xml
│ ├── src
│ │ └── main
│ └── target
│ ├── atlas-buildtools-1.0.jar
│ ├── classes
│ └── maven-archiver
├── client
│ ├── client-v1
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ ├── client-v2
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ ├── common
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ ├── pom.xml
│ ├── src
│ │ └── main
│ └── target
│ ├── maven-shared-archive-resources
│ └── rat.txt
├── common
│ ├── pom.xml
│ ├── src
│ │ ├── main
│ │ └── test
│ └── target
│ ├── atlas-common-3.0.0-SNAPSHOT-tests.jar
│ ├── atlas-common-3.0.0-SNAPSHOT.jar
│ ├── classes
│ ├── generated-sources
│ ├── generated-test-sources
│ ├── maven-archiver
│ ├── maven-shared-archive-resources
│ ├── maven-status
│ ├── rat.txt
│ └── test-classes
├── dashboardv2
│ ├── gruntfile.js
│ ├── package-lock.json
│ ├── package.json
│ ├── pom.xml
│ ├── public
│ │ ├── css
│ │ ├── ieerror.html
│ │ ├── img
│ │ ├── index.html.tpl
│ │ ├── js
│ │ └── migration-status.html.tpl
│ └── target
│ ├── atlas-dashboardv2-3.0.0-SNAPSHOT
│ ├── atlas-dashboardv2-3.0.0-SNAPSHOT.war
│ ├── classes
│ ├── dist
│ ├── gruntfile.js
│ ├── maven-archiver
│ ├── maven-shared-archive-resources
│ ├── node
│ ├── node_modules
│ ├── package-lock.json
│ ├── package.json
│ ├── rat.txt
│ └── test-classes
├── dashboardv3
│ ├── gruntfile.js
│ ├── package-lock.json
│ ├── package.json
│ ├── pom.xml
│ ├── public
│ │ ├── css
│ │ ├── ieerror.html
│ │ ├── img
│ │ ├── index.html.tpl
│ │ └── js
│ └── target
│ ├── atlas-dashboardv3-3.0.0-SNAPSHOT
│ ├── atlas-dashboardv3-3.0.0-SNAPSHOT.war
│ ├── classes
│ ├── dist
│ ├── gruntfile.js
│ ├── maven-archiver
│ ├── maven-shared-archive-resources
│ ├── node
│ ├── node_modules
│ ├── package-lock.json
│ ├── package.json
│ ├── rat.txt
│ └── test-classes
├── dev-support
│ ├── atlas-docker
│ │ ├── Dockerfile
│ │ ├── Dockerfile.atlas
│ │ ├── Dockerfile.atlas-base
│ │ ├── Dockerfile.atlas-build
│ │ ├── README.md
│ │ ├── data
│ │ ├── dist
│ │ ├── docker-compose.atlas-base.yml
│ │ ├── docker-compose.atlas-build.yml
│ │ ├── docker-compose.atlas.yml
│ │ ├── patches
│ │ └── scripts
│ ├── atlas-scripts
│ │ ├── README.txt
│ │ ├── admin_status.sh
│ │ ├── classificationdef_get.sh
│ │ ├── entity_classification_bulk.sh
│ │ ├── entity_classifications_add.sh
│ │ ├── entity_classifications_delete.sh
│ │ ├── entity_classifications_update.sh
│ │ ├── entity_create.sh
│ │ ├── entity_delete_by_guid.sh
│ │ ├── entity_get_by_guid.sh
│ │ ├── entity_get_by_type_and_unique_attr.sh
│ │ ├── entity_update.sh
│ │ ├── entity_update_by_type_and_unique_attr.sh
│ │ ├── entitydef_get.sh
│ │ ├── enumdef_get.sh
│ │ ├── env_atlas.sh
│ │ ├── export_entity_by_guid.sh
│ │ ├── export_entity_by_type_and_attr.sh
│ │ ├── import_zip.sh
│ │ ├── sample-data
│ │ ├── search_basic.sh
│ │ ├── search_basic_with_attribute_filters.sh
│ │ ├── search_dsl.sh
│ │ ├── structdef_get.sh
│ │ ├── typedefs_create.sh
│ │ ├── typedefs_delete.sh
│ │ ├── typedefs_get.sh
│ │ └── typedefs_update.sh
│ ├── findbugsIncludeFile.xml
│ ├── smart-apply-patch.sh
│ └── test-patch.sh
├── distro
│ ├── pom.xml
│ ├── src
│ │ ├── bin
│ │ ├── conf
│ │ ├── data
│ │ ├── logs
│ │ ├── main
│ │ ├── server
│ │ └── test
│ └── target
│ ├── META-INF
│ ├── apache-atlas-3.0.0-SNAPSHOT-atlas-index-repair.zip
│ ├── apache-atlas-3.0.0-SNAPSHOT-bin.tar.gz
│ ├── apache-atlas-3.0.0-SNAPSHOT-classification-updater.zip
│ ├── apache-atlas-3.0.0-SNAPSHOT-falcon-hook.tar.gz
│ ├── apache-atlas-3.0.0-SNAPSHOT-hbase-hook.tar.gz
│ ├── apache-atlas-3.0.0-SNAPSHOT-hive-hook.tar.gz
│ ├── apache-atlas-3.0.0-SNAPSHOT-impala-hook.tar.gz
│ ├── apache-atlas-3.0.0-SNAPSHOT-kafka-hook.tar.gz
│ ├── apache-atlas-3.0.0-SNAPSHOT-server.tar.gz
│ ├── apache-atlas-3.0.0-SNAPSHOT-sources.tar.gz
│ ├── apache-atlas-3.0.0-SNAPSHOT-sqoop-hook.tar.gz
│ ├── apache-atlas-3.0.0-SNAPSHOT-storm-hook.tar.gz
│ ├── archive-tmp
│ ├── atlas-distro-3.0.0-SNAPSHOT.jar
│ ├── bin
│ ├── conf
│ ├── data
│ ├── logs
│ ├── maven-archiver
│ ├── maven-shared-archive-resources
│ ├── rat.txt
│ ├── server
│ └── test-classes
├── docs
│ ├── docz-lib
│ │ ├── config
│ │ ├── docz
│ │ └── docz-core
│ ├── doczrc.js
│ ├── package.json
│ ├── pom.xml
│ ├── src
│ │ ├── documents
│ │ └── resources
│ ├── target
│ │ ├── atlas-docs-3.0.0-SNAPSHOT.jar
│ │ ├── classes
│ │ ├── docz-lib
│ │ ├── doczrc.js
│ │ ├── maven-archiver
│ │ ├── maven-shared-archive-resources
│ │ ├── package.json
│ │ ├── pom.xml
│ │ ├── rat.txt
│ │ ├── src
│ │ ├── test-classes
│ │ └── theme
│ └── theme
│ ├── components
│ ├── config.js
│ ├── index.js
│ ├── styles
│ └── utils
├── graphdb
│ ├── api
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ ├── common
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ ├── graphdb-impls
│ │ ├── pom.xml
│ │ └── target
│ ├── janus
│ │ ├── pom.xml
│ │ ├── readme.txt
│ │ ├── src
│ │ └── target
│ ├── janus-hbase2
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ ├── pom.xml
│ ├── readme.txt
│ └── target
│ ├── maven-shared-archive-resources
│ └── rat.txt
├── intg
│ ├── pom.xml
│ ├── src
│ │ ├── main
│ │ └── test
│ └── target
│ ├── atlas-intg-3.0.0-SNAPSHOT-tests.jar
│ ├── atlas-intg-3.0.0-SNAPSHOT.jar
│ ├── classes
│ ├── generated-sources
│ ├── generated-test-sources
│ ├── maven-archiver
│ ├── maven-shared-archive-resources
│ ├── maven-status
│ ├── rat.txt
│ └── test-classes
├── notification
│ ├── pom.xml
│ ├── src
│ │ ├── main
│ │ └── test
│ └── target
│ ├── atlas-notification-3.0.0-SNAPSHOT.jar
│ ├── classes
│ ├── dependency
│ ├── generated-sources
│ ├── generated-test-sources
│ ├── maven-archiver
│ ├── maven-shared-archive-resources
│ ├── maven-status
│ ├── rat.txt
│ └── test-classes
├── plugin-classloader
│ ├── pom.xml
│ ├── src
│ │ ├── main
│ │ └── test
│ └── target
│ ├── atlas-plugin-classloader-3.0.0-SNAPSHOT.jar
│ ├── classes
│ ├── generated-sources
│ ├── generated-test-sources
│ ├── maven-archiver
│ ├── maven-shared-archive-resources
│ ├── maven-status
│ ├── rat.txt
│ └── test-classes
├── pom.xml
├── release-build.xml
├── release-log.txt
├── repository
│ ├── pom.xml
│ ├── src
│ │ ├── main
│ │ └── test
│ └── target
│ ├── atlas-repository-3.0.0-SNAPSHOT-tests.jar
│ ├── atlas-repository-3.0.0-SNAPSHOT.jar
│ ├── classes
│ ├── generated-sources
│ ├── generated-test-sources
│ ├── maven-archiver
│ ├── maven-shared-archive-resources
│ ├── maven-status
│ ├── rat.txt
│ ├── solr
│ └── test-classes
├── server-api
│ ├── pom.xml
│ ├── src
│ │ └── main
│ └── target
│ ├── atlas-server-api-3.0.0-SNAPSHOT.jar
│ ├── classes
│ ├── generated-sources
│ ├── maven-archiver
│ ├── maven-shared-archive-resources
│ ├── maven-status
│ ├── rat.txt
│ └── test-classes
├── target
│ ├── maven-shared-archive-resources
│ │ └── META-INF
│ └── rat.txt
├── test-tools
│ ├── pom.xml
│ ├── src
│ │ └── main
│ └── target
│ ├── atlas-testtools-3.0.0-SNAPSHOT.jar
│ ├── classes
│ ├── generated-sources
│ ├── maven-archiver
│ ├── maven-shared-archive-resources
│ ├── maven-status
│ ├── rat.txt
│ └── test-classes
├── tools
│ ├── atlas-index-repair
│ │ ├── README
│ │ ├── pom.xml
│ │ ├── src
│ │ └── target
│ ├── atlas-migration-exporter
│ │ ├── README
│ │ ├── atlas-log4j.xml
│ │ └── atlas_migration_export.py
│ └── classification-updater
│ ├── pom.xml
│ ├── src
│ └── target
└── webapp
├── pom.xml
├── src
│ ├── main
│ └── test
└── target
├── api
├── atlas-webapp-3.0.0-SNAPSHOT
├── atlas-webapp-3.0.0-SNAPSHOT-classes.jar
├── atlas-webapp-3.0.0-SNAPSHOT.war
├── atlas.keystore
├── classes
├── enunciate
├── generated-sources
├── generated-test-sources
├── maven-archiver
├── maven-shared-archive-resources
├── maven-status
├── models
├── rat.txt
├── solr
├── test-classes
└── war
Whenever I want to run atlas_start.py file, I faced to following logs:
/bigdata/atlas/distro/src/conf/atlas-env.sh: line 59: MANAGE_LOCAL_HBASE=${hbase.embedded}: bad substitution
/bigdata/atlas/distro/src/conf/atlas-env.sh: line 62: MANAGE_LOCAL_SOLR=${solr.embedded}: bad substitution
/bigdata/atlas/distro/src/conf/atlas-env.sh: line 65: MANAGE_EMBEDDED_CASSANDRA=${cassandra.embedded}: bad substitution
/bigdata/atlas/distro/src/conf/atlas-env.sh: line 68: MANAGE_LOCAL_ELASTICSEARCH=${elasticsearch.managed}: bad substitution
java.io.FileNotFoundException: /bigdata/atlas/distro/src/server/webapp/atlas.war (No such file or directory)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:112)
at jdk.jartool/sun.tools.jar.Main.run(Main.java:407)
at jdk.jartool/sun.tools.jar.Main.main(Main.java:1681)
The Server is no longer running with pid 29164
starting atlas on host localhost
starting atlas on port 21000
..............................................................................................................................................................................................................................................................................................................
Apache Atlas Server started!!!
here is the curl:
curl -u username:password http://localhost:21000/api/atlas/v2/types/typedefs/headers
error:
curl: (7) Failed to connect to localhost port 21000: Connection refused
After struggling with Apache Atlas for a while, I found 3.0.0 Snapshot version very buggy! Therefore I have decided to build and install Apache Atlas 2.1.0 RC3.
Prerequisite:
Make sure you have installed java on your machine. In case it is not installed on your computer, you can install it using the following command in Linux:
sudo apt-get install openjdk-8-jre
Then JAVA_HOME should be set:
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
Building:
Download Apache Atlas 2.1.0-rc3:
wget https://github.com/apache/atlas/archive/refs/tags/release-2.1.0-rc3.tar.gz
Unpack it:
tar -xzvf release-2.1.0-rc3.tar.gz
Set environment variables:
export MANAGE_LOCAL_HBASE=true
export MANAGE_LOCAL_SOLR=true
Execute:
mvn clean -DskipTests install
mvn clean -DskipTests package -Pdist,embedded-hbase-solr
Change the directory to distro/target and unpack the server tar file:
cd distro/target
tar -xzvf apache-atlas-2.1.0-server.tar.gz
Change the directory to apache-atlas-2.1.0-server and run execute atlas_start.py script:
cd apache-atlas-2.1.0-server
bin/atlas_start.py
Important Tip 1: In official documentation it is said to change directory to apache-atlas-2.1.0, not apache-atlas-2.1.0-server. I have tried it but it doesn't work.
Important Tip 2: The following log doesn't mean that Apache Atlas is currently running!
configured for local hbase.
hbase started.
configured for local solr.
solr started.
setting up solr collections…
starting atlas on host localhost
starting atlas on port 21000
Apache Atlas Server started!!
To ensure that it is working properly or not, check the application.log in logs directory. If everything would be OK, it takes about 10 minutes to run without any error.
Brief screenshot of logs/application.log:
**Check the function:**
> curl -u admin:admin http://localhost:21000/api/atlas/admin/version
{"Description":"Metadata Management and Data Governance Platform over Hadoop","Revision":"release","Version":"2.1.0","Name":"apache-atlas"}%
or
http://localhost:21000 should look-like the following picture:
I want to thank Mark Chesnavsky helping me to resolve this issue. If you have any other issue you can check his post.
I have a TeamCity settings.kts file where it consists of the Root Project and hence all subsequent sub project. Currently, it's one big massive file and I am trying to split up the KTS file based on projects.
What's the best practice to split up the settings file? Should I do a file per project and how do I reference them from the main settings file?
TeamCity generates a singe settings.kts file only for small projects.
You can try and play with some big project, download settings in Kotlin format for it.
E.g., here is how generated by TeamCity big project settings look like:
nadias-mbp:projectSettings 2 nburnasheva$ tree
.
├── README
├── ServiceMessages
│ ├── Project.kt
│ └── buildTypes
│ ├── ServiceMessagesChangeBuildStatus.kt
│ ├── ServiceMessages_BuildProgressServiceMessage.kt
│ ├── ServiceMessages_ErrorParsingServiceMessage.kt
│ ├── ServiceMessages_FailBuild.kt
│ └── ServiceMessages_ReportBuildParameterDoNotReport.kt
├── ServiceMessages_ReportBuildParametersChar
│ ├── Project.kt
│ └── buildTypes
│ ├── ServiceMessages_ReportBuildParametersChar_ReportBuildParameter.kt
│ ├── ServiceMessages_ReportBuildParametersChar_ReportBuildParameterWaitReasonWithTooLongValue.kt
│ └── ServiceMessages_ReportBuildParametersChar_ThreadSleep.kt
├── ServiceMessages_ReportBuildParametersChartCopy
│ ├── Project.kt
│ └── buildTypes
│ └── ServiceMessages_ReportBuildParametersChartCopy_ReportBuildPara.kt
├── _Self
│ ├── Project.kt
│ ├── buildTypes
│ │ ├── AnsiParseAnsiColorLoggerOutput.kt
│ │ ├── BuildStepsAutodetection.kt
│ │ ├── CheckPromptParameter.kt
│ │ ├── EchoBuildIdToFile.kt
│ │ ├── EchoParametersToConsole.kt
│ │ ├── EchoUmlaut.kt
│ │ ├── FailBuildOnTextInTheLogs.kt
│ │ ├── MpsQuottingTest.kt
│ │ ├── RunGitCommand.kt
│ │ ├── RunMavenFromCommandLine.kt
│ │ ├── SetPasswordParameterInServiceMessages.kt
│ │ ├── SimpleWindowsEcho.kt
│ │ ├── SparseFile.kt
│ │ └── StderrRunAsOnMacOS.kt
│ └── vcsRoots
│ ├── HttpsGithubComBanadigaPhotoBackupGitRefsHeadsMaster.kt
│ └── HttpsGithubComBurnashevaCommandLineRunnerGitRefsHeadsMaster.kt
├── pom.xml
└── settings.kts
9 directories, 32 files
And here is the content of settings.kts:
import jetbrains.buildServer.configs.kotlin.v2018_2.*
version = "2019.1"
project(_Self.Project)
I am trying to apply an example from the book Gradle in Action to learn how to separate a gradle application into subprojects. I did the example in the book and everything worked out fine.
I decided to apply the same concepts to a sample application from the Griffon Framework called minimalistic build, source code: sources. I selected this application because it follows the normal application structure instead of Griffon's, and I was trying to fill the gap (IMHO) in Griffon's documentation for multi project builds: it has one exaple that uses Open-Dolphin, Swing, JavaFX, Servlets that I felt it was too complicated to learn the basics.
Of course I hit the wall big time, multiple times...
Griffon's JavaFX application has the following structure:
├── build.gradle
├── config
│ └── HEADER
├── gradle
│ ├── functional-test.gradle
│ ├── integration-test.gradle
│ ├── javafx-plugin.gradle
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
└── src
├── functional-test
│ └── java
│ └── org
│ └── example
│ └── SampleFunctionalTest.java
├── integration-test
│ └── java
│ └── org
│ └── example
│ └── SampleIntegrationTest.java
├── main
│ ├── java
│ │ ├── Config.java
│ │ └── org
│ │ └── example
│ │ ├── Launcher.java
│ │ ├── SampleController.java
│ │ ├── SampleModel.java
│ │ ├── SampleService.java
│ │ └── SampleView.java
│ └── resources
│ ├── application.properties
│ ├── griffon-icon-128x128.png
│ ├── griffon-icon-16x16.png
│ ├── griffon-icon-24x24.png
│ ├── griffon-icon-256x256.png
│ ├── griffon-icon-32x32.png
│ ├── griffon-icon-48x48.png
│ ├── griffon-icon-64x64.png
│ ├── griffon.png
│ ├── log4j.properties
│ ├── messages.properties
│ ├── META-INF
│ │ └── griffon
│ │ ├── griffon.core.artifact.GriffonController
│ │ ├── griffon.core.artifact.GriffonModel
│ │ ├── griffon.core.artifact.GriffonService
│ │ └── griffon.core.artifact.GriffonView
│ ├── org
│ │ └── example
│ │ └── sample.fxml
│ └── resources.properties
└── test
└── java
└── org
└── example
├── SampleControllerTest.java
└── SampleServiceTest.java
The build.gradle file content is:
// tag::plugins[]
plugins {
id 'java'
id 'idea'
id 'com.github.ben-manes.versions' version '0.12.0'
id 'com.github.hierynomus.license' version '0.11.0'
}
apply from: 'gradle/javafx-plugin.gradle'
apply from: 'gradle/integration-test.gradle'
apply from: 'gradle/functional-test.gradle'
// end::plugins[]
// tag::javafx[]
javafx {
mainClass = 'org.example.Launcher'
}
// end::javafx[]
// tag::dependencies[]
repositories {
jcenter()
mavenLocal()
}
dependencies {
compile "org.codehaus.griffon:griffon-javafx:${griffonVersion}"
compile "org.codehaus.griffon:griffon-guice:${griffonVersion}"
runtime('log4j:log4j:1.2.17') {
exclude group: 'ant', module: 'ant-nodeps'
exclude group: 'ant', module: 'ant-junit'
exclude group: 'ant-contrib', module: 'ant-contrib'
}
runtime 'org.slf4j:slf4j-log4j12:1.7.21'
testCompile "org.codehaus.griffon:griffon-javafx-test:${griffonVersion}"
testCompile 'pl.pragmatists:JUnitParams:1.0.5'
testCompile 'org.mockito:mockito-core:2.0.59-beta'
}
// end::dependencies[]
// tag::resources[]
processResources {
from(sourceSets.main.resources.srcDirs) {
exclude '**/*.properties'
exclude '**/*.xml'
}
from(sourceSets.main.resources.srcDirs) {
include '**/*.properties'
include '**/*.xml'
filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: [
'application.name' : project.name,
'application.version': project.version,
'griffon.version' : griffonVersion
])
}
}
// end::resources[]
license {
header = rootProject.file('config/HEADER')
strictCheck = true
ignoreFailures = true
mapping {
java = 'SLASHSTAR_STYLE'
fxml = 'XML_STYLE'
}
ext.year = '2016'
exclude '**/*.png'
}
And the structure I was trying to achieve is:
├── build.gradle
├── config
│ └── HEADER
├── gradle
│ ├── functional-test.gradle
│ ├── integration-test.gradle
│ ├── javafx-plugin.gradle
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── launcher
│ ├── launcher-build.gradle
│ └── src
│ └── main
│ └── java
│ ├── Config.java
│ └── org
│ └── example
│ └── Launcher.java
├── resources
│ ├── resources-build.gradle
│ └── src
│ └── main
│ └── resources
│ ├── application.properties
│ ├── griffon-icon-128x128.png
│ ├── griffon-icon-16x16.png
│ ├── griffon-icon-24x24.png
│ ├── griffon-icon-256x256.png
│ ├── griffon-icon-32x32.png
│ ├── griffon-icon-48x48.png
│ ├── griffon-icon-64x64.png
│ ├── griffon.png
│ ├── log4j.properties
│ ├── messages.properties
│ └── resources.properties
├── service
│ ├── resources
│ │ └── META-INF
│ │ └── griffon
│ │ └── griffon.core.artifact.GriffonController
│ ├── service-build.gradle
│ └── src
│ ├── main
│ │ └── java
│ │ └── org
│ │ └── example
│ │ └── SampleService.java
│ └── test
│ └── java
│ └── org
│ └── example
│ └── SampleServiceTest.java
├── settings.gradle
└── view
├── src
│ ├── functional-test
│ │ └── java
│ │ └── org
│ │ └── example
│ │ └── SampleFunctionalTest.java
│ ├── integration-test
│ │ └── java
│ │ └── org
│ │ └── example
│ │ └── SampleIntegrationTest.java
│ ├── main
│ │ ├── java
│ │ │ └── org
│ │ │ └── example
│ │ │ ├── SampleController.java
│ │ │ ├── SampleModel.java
│ │ │ └── SampleView.java
│ │ └── resources
│ │ ├── META-INF
│ │ │ └── griffon
│ │ │ ├── griffon.core.artifact.GriffonModel
│ │ │ ├── griffon.core.artifact.GriffonService
│ │ │ └── griffon.core.artifact.GriffonView
│ │ └── org
│ │ └── example
│ │ └── sample.fxml
│ └── test
│ └── java
│ └── org
│ └── example
│ └── SampleControllerTest.java
└── view-build.gradle
I don't know if that structure is the one that makes more sense, but is the one I first thought of.
Regardless everything I tried I could not build this project and I am wondering if anyone could tell me if I made a mistake with the selection of the subprojects and what should be the content for the build files.
I created a zip file with the rearranged source here keeping the original build.gradle file untouched, with a settings.gradle file that makes Gradle properly recognize the new structure.
Thanks!
The problem is caused by missing resource files in the service project. You'll find a similar problem in the view project. This is is because all resource files were moved to another location (the resources project). There was no problem before splitting the application into subprojects because all resources were at the right place.
You can fix the build by following these steps:
$ cd service
$ mkdir -p src/test/resources
$ touch src/test/resources/Config.properties
$ mkdir -p src/main/resources
$ mv ../resources/src/main/resources/messages.properties src/main/resources/
$ cd ../view
$ mkdir -p src/test/resources
$ touch src/test/resources/Config.properties
This should be enough to make the tests green again.
Marcelo,
I've posted a new version of the multi-project build here. This version keeps common setup at the root level, leaving what's specific to each subproject on each subproject's build file.
I'm currently working on a SASS library which is a long list of partials imported into 1 file.
The file structure is as following:
css-directory
├── functions
│ ├── _px2em.scss
│ └── _unitless.scss
├── helpers
│ ├── _align.scss
│ ├── _clearfix.scss
│ ├── _float.scss
│ ├── _hidden.scss
│ ├── _invisible.scss
│ ├── _ir.scss
│ └── _visuallyhidden.scss
├── layout
│ ├── _blockquote.scss
│ ├── _button.scss
│ ├── _fixed-footer.scss
│ ├── _form.scss
│ ├── _list.scss
│ ├── _loading.scss
│ ├── _triangle.scss
│ └── _truncate.scss
├── modules
│ ├── _grid.scss
│ └── _normalize.scss
├── prefixes
│ ├── _animation-delay.scss
│ ├── _animation.scss
│ ├── _background-clip.scss
│ ├── _borderbox.scss
│ ├── _border-radius.scss
│ ├── _box-shadow.scss
│ ├── _box-sizing.scss
│ ├── _flex.scss
│ ├── _font-face.scss
│ ├── _gradient.scss
│ ├── _hyphens.scss
│ ├── _keyframes.scss
│ ├── _transform-origin.scss
│ ├── _transform.scss
│ ├── _transition.scss
│ └── _user-select.scss
└── _verepo.scss
and the _verepo.scss file imports all the other partials.
I'd like to be able to concatenate _verepo.scss and it's partials into 1 .scss file so that I can then distribute it easily.
Found a solution, by using grunt and grunt-contrib-concat.
Fixed it with the following code block inside of grunt's initConfig:
concat: {
options: {
banner: '/*! veRepo.scss v%VERSION% | MIT License | https://github.com/varemenos/verepo */\n\n'
},
dist: {
src: [
'src/functions/_**.scss',
'src/prefixes/_**.scss',
'src/helpers/_**.scss',
'src/layout/_**.scss',
'src/modules/_**.scss',
],
dest: '_verepo.scss'
}
}