Here's a command to get the count of js lines in a node project:
find . -name '*.js' ! -path '*node_module*' | xargs wc -l
The -path part is to exclude the node_modules folders so you don't count 3rd part libs.
Thursday, December 29, 2016
Wednesday, June 8, 2016
Quick Tip - import recognized in IntelliJ Idea
If you know you have the correct gradle configuration for an library, but the import isn't recognized in IntelliJ Idea, do the following:
File menu -> Invalidate Caches/Restart...
This can take a while. IDEA will rebuild indexes. But sometimes, this is required!
At command-line, you may need:
./gradlew clean build --refresh-dependencies
File menu -> Invalidate Caches/Restart...
This can take a while. IDEA will rebuild indexes. But sometimes, this is required!
At command-line, you may need:
./gradlew clean build --refresh-dependencies
Friday, May 20, 2016
Kickstarting a Java program
Here are steps to create a new Java command-line program. Use a different quick start if you are making a web server as there are guides for those.
0. Prerequisite: Install Gradle.
1. Create an empty folder, we will refer to as project1.
2. Copy this build.gradle code into a new build.gradle file in your project1 folder.
(Modified from https://docs.gradle.org/current/userguide/tutorial_java_projects.html )
3. At terminal, run
4. At terminal, run
5. Open in idea
6. In IDEA, create this folder structure: src->main->java->project1
7. Right-click on the "java", mark as sources root.
8. Same thing for tests: src->test->java, mark java as test sources root.
0. Prerequisite: Install Gradle.
1. Create an empty folder, we will refer to as project1.
2. Copy this build.gradle code into a new build.gradle file in your project1 folder.
(Modified from https://docs.gradle.org/current/userguide/tutorial_java_projects.html )
apply plugin: 'java'apply plugin: 'idea'
sourceCompatibility = 1.8version = '0.1'jar {
manifest {
attributes 'Implementation-Title': 'War Game',
'Implementation-Version': version
}
}
repositories {
mavenCentral()
}
dependencies {
compile group: 'commons-collections',
name: 'commons-collections',
version: '3.2.2'
testCompile group: 'junit',
name: 'junit', version: '4.+'}
test {
systemProperties 'property': 'value'}
uploadArchives {
repositories {
flatDir {
dirs 'repos' }
}
}
3. At terminal, run
gradle wrapperThis will create a gradlew file for you.
4. At terminal, run
gradlew ideaAssuming using idea.
5. Open in idea
6. In IDEA, create this folder structure: src->main->java->project1
7. Right-click on the "java", mark as sources root.
8. Same thing for tests: src->test->java, mark java as test sources root.
Subscribe to:
Comments (Atom)