I have below folder structure of my angular application
web\src\app\main
in main folder I have folder for different modules like
web\src\app\main\userinfo
web\src\app\main\packages
Location of tsconfig.app.json is scr/tsconfig.app.json
I want to exclude userinfo and packages folder completely form the build
I added below code in tsconfig.app.json to exclude userInfo
"exclude": [
"src/test.ts",
"**/*.spec.ts",
"./src/app/main/userinfo/"
]
But it's not working
The build size is same,
If this module is not included then build size should get reduce
Related
If my project has the following folder structure:
Project
├───build
├───images
├───include
├───Apps
├───Models
├───source
└───tests
what is the best way to make the folder "images" accessable to all .cpp files inside build, tests, apps and src without using the absolute path. So every image created inside this project should be saved to the "images" folder.
I am building with Cmake if this is important(started using CMake last week so no deep knowledge). Main CmakeLists.txt file is the the root folder. Tests, Apps and source each have their own CMakeLists.txt files and executables.
Every image will be created with the same class so I think I could use std::filesystem::current_path() with a wrapper function inside the class which would generate and set the desired path but there should be another way.
I will also load files from the folder Models in the future, so the same problem.
If I am understanding your question correctly you want to access the images from the "images" folder, right? You should be thinking about the path from the point of the final executable and not the source files.
If the executable will be in the build directory then you simply need to write "../images", the 2 dots mean that you are going back 1 directory.
How to create an executable jar project for Geb-Groovy based project in eclipse.
The following is the directory structure:
the pages package contains the groovy files
the testclasses package contains the test cases groovy files
the utils package contains the groovy files to read data of excel sheets.
Detailed instructions for creating the jar file would be highly appreciated.
If the project you are working with is a gradle project I would recommend looking at a task called "shadowJar" https://github.com/johnrengelman/shadow
in build.gradle would have something like this:
apply plugin: "com.github.johnrengelman.shadow"
mainClassName = '<Name of your Main Class>' //This will act as the jar's main point of entry the 'Main' method found in this class will be executed when the jar is executed
shadowJar {
manifest {
attributes 'Main-Class': mainClassName
}
}
Then you simply make a run the shadowJar task and a jar file is generated in your build folder. It should also contain all your dependencies as well.
I'm working on an Ember.js project and would like to leverage the Slick Carousel library. I've installed the library via Bower in my project folder, and am having difficulty with importing it into my project.
In my ember-cli-build.js, I've added import statements as follows:
app.import('bower_components/slick-carousel/slick/slick.css');
app.import('bower_components/slick-carousel/slick/slick-theme.css');
app.import('bower_components/slick-carousel/slick/slick.js');
The issue I am running into is that the rest of the required assets do not get built and included in the dist folder when I do a build (fonts, assets, etc.), leading to errors with missing fonts and assets that are present in the "bower_components/slick-carousel" folder, but not in the build of my actual Ember application.
Edit: It looks like Broccoli-Funnel was what I needed. The issue was resolved by specifying the source files from the 'bower_components' folder and pointing the relative path to the 'dist' folder in the ember-cli-build.js file.
As a note: The 'broccoli-static-compiler' plugin commonly referenced elsewhere as the solution is deprecated, with the use of 'broccoli-funnel' as the recommended plugin.
Broccoli-funnel ended up being what I was looking for. By placing the following inside of ember-cli-build.js, the needed files would be placed in the correct directory during build:
var Funnel = require('broccoli-funnel');
var requiredAssets = new Funnel('bower_components/slick-carousel/slick/fonts', {
srcDir: '/',
include: ['**/*.*'],
destDir: '/assets/fonts'
});
return app.toTree([requiredAssets]);
I am severely confused about where to put my templates files and static files.
I understand absolute and relative paths just fine, but I can't seem to find any instructions that mirror the installation I have. I know this resembles other questions, but those answers aren't working. The video I watched to successfully build a simple app didn't put templates in the Project folder, which is where logic tells me they should be.
I have Python at:
C:\Python27
Django (v1.6.5) at:
C:\Python27\Lib\site-packages\django
I created a project "mysite" and an app called "films."
Project "mysite":
C:\Python27\Scripts\venv\mysite
and an App "films":
C:\Python27\Scripts\venv\mysite\films
The video I watched had me put my templates at:
C:\Python27\Lib\site-packages\django\contrib\admin\templates
But this seems completely stupid because the templates are outside of both the Project and the App.
Shouldn't I put a templates folder in the Project folder:
C:\Python27\Scripts\venv\mysite\templates
And then create subdirectories using the App name?
What files do I need to edit (and how) to tell Django where to find them?
Follow a similar process for static files (css, images)?
Like all frameworks, django offers great benefits if you follow some guidelines (and give up some control). The trick is to know what these guidelines are.
For templates:
If the template is not tied to a particular application, put it in a templates directory at the root of your project. Add the full path to this directory to TEMPLATE_DIRS.
All other templates should go in a directory called templates inside your application directory. So if you application is called myapp, templates for myapp will go in myapp/templates/
For static files:
For files related to specific applications, inside your application directory create a directory called static, then inside it a directory with the name of your application. So, if your application is called myapp, you would have myapp/static/myapp. Place all your static content for this application here; for example myapp/static/myapp/js/funky.js.
For static files that are generic, create a directory called assets (or static) in the root directory of your project. Add the full path to this directory to STATICFILES_DIRS.
By default, django will search all applications listed in INSTALLED_APPS, and add any templates and static directories to its search path for files. This is how, by default, the admin works without you having to configure anything.
If you chose to place your templates and static files in some other location, only then do you need to modify the TEMPLATE_DIRS and STATICFILES_DIRS settings. If all your templates and static assets are tied to applications, just creating the directories as mentioned above makes everything work.
If you are wondering why you need to create another directory under myapp/static/ to store your static files, this is more for portability. The collectstatic command is a simply "copy and replace" utility. It will overwrite all files in the STATIC_DIR location. This means that if two applications have some static file with the same name, they will be overwritten without warning. Adding a subdirectory keeps your application's static assets from being overwritten, because the exact path will be created.
Suppose you have two applications, app1 and app2, and both have a file named style.css in their respected directories:
app1/static/css/style.css
app2/static/css/style.css
When you run collectstatic, you'll end up with the following (assuming static is the name of your STATIC_DIR setting):
static/css/style.css
This may be the style.css from app1 or app2, the other cannot be determined (its actually based on the INSTALLED_APPS order). To prevent this, if you have:
app1/static/app1/css/style.css
app2/static/app2/css/style.css
Now, you'll end up with:
static/app1/css/style.css
static/app2/css/style.css
Both files will be preserved.
You also shouldn't put your code in your virtual environment directory. The virtual environment is not part of your source code, and placing your project in the same directory may cause problems later.
Create a single directory for your environments - I call mine envs (creative, I know). Create all your environments in this directory. Once you activate the environment, you can work in any directory in your system and your shell will be configured for that environment's Python.
Finally for the best, accurate, most up-to-date information - always refer to the django manual and the tutorial. Almost all other resources (even the often suggested djangobook.com) are outdated.
I created a django project and as it was recommended in django tutorial I placed static files like .js in separate folder as well as template directory.
The result structure is like:
MyProject >
scripts # place for .py files
static # .js, .jpg etc
templates
Now when I open MyProject directory in PyCharm, it wants all imports starting with "scripts". Like from scripts.myapp.mymodule import MyFunc. But it is ugly.
Is it possible to open all 3 directories as one project or tell PyCharm where the sources are?
Go to Settings | Project Structure and mark the 'scripts' directory as a source root.