Skylark IDE info aspect: sources and dependencies.

1. Refactored IntelliJSkylarkAspectTest. Eventually that test will be
merged with AndroidStudioInfoAspect test to validate implementation
equivalence.

2. Exposed ``root`` and ``is_source`` on Artifacts to Skylark.

3. Skylark aspect implementation outputs sources and dependencies
information.

--
MOS_MIGRATED_REVID=112473407
diff --git a/src/test/java/com/google/devtools/build/lib/actions/ArtifactTest.java b/src/test/java/com/google/devtools/build/lib/actions/ArtifactTest.java
index 81fabbb..cd97821 100644
--- a/src/test/java/com/google/devtools/build/lib/actions/ArtifactTest.java
+++ b/src/test/java/com/google/devtools/build/lib/actions/ArtifactTest.java
@@ -337,6 +337,27 @@
     assertThat(constructed).isEqualTo("aaa/bbb/ccc/ddd");
   }
 
+  @Test
+  public void testIsSourceArtifact() throws Exception {
+    assertThat(
+        new Artifact(scratch.file("/src/foo.cc"), Root.asSourceRoot(scratch.dir("/")),
+            new PathFragment("src/foo.cc"))
+            .isSourceArtifact())
+        .isTrue();
+    assertThat(
+        new Artifact(scratch.file("/genfiles/aaa/bar.out"),
+            Root.asDerivedRoot(scratch.dir("/genfiles"), scratch.dir("/genfiles/aaa")))
+            .isSourceArtifact())
+        .isFalse();
+
+  }
+
+  @Test
+  public void testGetRoot() throws Exception {
+    Root root = Root.asDerivedRoot(scratch.dir("/newRoot"));
+    assertThat(new Artifact(scratch.file("/newRoot/foo"), root).getRoot()).isEqualTo(root);
+  }
+
   private Artifact createDirNameArtifact() throws Exception {
     return new Artifact(scratch.file("/aaa/bbb/ccc/ddd"), Root.asDerivedRoot(scratch.dir("/")));
   }